Commit Graph

17 Commits

Author SHA1 Message Date
Peter Steinberger
35cdd40182 fix(cli): reject unsafe duration values 2026-05-29 04:06:56 -04:00
Michael Appel
84b9704ccc Validate wide-area DNS zone domains [AI] (#84136)
* fix: validate wide-area dns domains

* addressing codex review

* fix(dns-cli): throw explicit DNS-name error on invalid --domain

resolveWideAreaDiscoveryDomain catches the validation error from
normalizeWideAreaDomain and returns null, so dns setup --domain foo/bar
fell through to the "No wide-area domain configured" branch instead of
surfacing the invalid-domain diagnostic. Validate explicit CLI/config
input directly so the user-facing setup command reports the actual
problem; preserve the resolver's silent env-fallback semantics for the
background callers that depend on graceful degradation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(gateway): lock in graceful degrade on invalid wide-area config

Drive startGatewayDiscovery through the real resolveWideAreaDiscoveryDomain
with wideAreaDiscoveryDomain: "foo/bar" so the test exercises the actual
swallow-and-return-null path. Asserts the operator-facing warning is
logged, writeWideAreaGatewayZone is never called, and startup completes
without throwing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(gateway): type resolveWideAreaDiscoveryDomain mock to match real signature

vi.fn(() => "openclaw.internal.") inferred the mock as `() => string`, so
mockImplementationOnce(realResolver) tripped tsgo:core:test with TS2345.
Apply the same vi.fn<typeof ...>(...) pattern the file already uses for
writeWideAreaGatewayZone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(changelog): note dns validation fix

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Agustin Rivera <agustin@rivera-web.com>
2026-05-26 09:43:58 -07:00
Mikael Goderdzishvili
eca9645365 fix(cli): waitForever must keep the event loop alive (#85694)
`waitForever()` is a public library export used by long-running embeds to
block until the host process is asked to exit. It called `interval.unref()`
on the keep-alive timer, which removes the timer from Node's active-handle
set. With no other ref'd handles, `await waitForever()` exits the process
in ~3ms with exit code 13 ("unsettled top-level await") instead of waiting.

Drop the `.unref()` so the interval actually keeps the loop alive, and
update the existing unit test (and comment) to lock in the new contract.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 13:36:56 +01:00
Peter Steinberger
5a2dfac674 test: dedupe cli utility mock read 2026-05-13 06:11:23 +01:00
Peter Steinberger
dd0c34f5df test: guard cli utils mock calls 2026-05-12 07:31:37 +01:00
Peter Steinberger
2fd29af86c test: tighten wait forever interval assertion 2026-05-09 05:30:04 +01:00
Peter Steinberger
fad580ff18 test: tighten cli parser error assertions 2026-05-09 01:18:56 +01:00
Vincent Koc
b165c0d10a fix(ci): restore main validation 2026-05-07 03:39:26 -07:00
Peter Steinberger
330ba1fa31 refactor: move canvas to plugin surfaces 2026-05-07 09:07:18 +01:00
Vincent Koc
5af1fe1bd0 fix(tui): prevent orphaned terminal sessions (#77662)
* fix(tui): prevent orphaned terminal sessions

* fix(doctor): repair heartbeat-poisoned main sessions

* fix(tui): preserve startup tls respawn

* fix: harden tui and doctor recovery paths
2026-05-05 16:34:18 -07:00
Peter Steinberger
22e2e45c57 fix(cli): skip respawn for foreground gateway 2026-04-27 15:01:33 +01:00
Peter Steinberger
3f1d6fe147 test: speed up cli and command suites 2026-03-31 02:25:02 +01:00
Peter Steinberger
fef688fb7a test: dedupe utility and config suites 2026-03-28 00:26:55 +00:00
Gustavo Madeira Santana
eff3c5c707 Session/Cron maintenance hardening and cleanup UX (#24753)
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 7533b85156
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: shakkernerd <165377636+shakkernerd@users.noreply.github.com>
Reviewed-by: @shakkernerd
2026-02-23 22:39:48 +00:00
Peter Steinberger
4ab85cee0b test(cli): table-drive repeated argv and byte-size checks 2026-02-21 23:28:07 +00:00
Peter Steinberger
861718e4dc test: group remaining suite cleanups 2026-02-21 21:44:57 +00:00
Peter Steinberger
2d5004cee4 perf(test): consolidate CLI utility tests 2026-02-16 00:18:27 +00:00