Repository navigation
fix(gmail): keep setup command failures readable - #131502
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Updated proof for head Current state: published; exact-head CI passed. No prepare or merge has run. Twelve files: production +40/-71 (net −31), tests +413/-92 (net +321), docs +3/-1. Gateway/native source and test diffs are empty. Gmail uses the shared process diagnostic owner, retaining bounded stdout/stderr tails and recorded termination metadata without changing successful output or auth/install/provisioning/retry decisions. The original reproduction had 15 intended failures. Real subprocess login/watch fixtures run 2/8 fake commands, retain both tails in 903/907-character failures, and leave config unchanged. ClawSweeper independently passed both fixtures. This is isolated fake-command proof, not authenticated Gmail or cloud proof. Gmail reconciliation: all 31 utility cases remain, including both upstream real filesystem/cache probes. A naive global-mock merge produced the expected two failures (installer 0 and missing-binary false success); the scoped actual-owner spy passed. The creates-binary case still failed against the actual pre-cache owner OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/hooks/gmail-setup-utils.test.ts -t 'ensureDependency binary availability'
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/hooks/gmail-setup-utils.test.ts
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/hooks/gmail-setup-utils.test.ts src/hooks/gmail-setup.integration.test.ts src/hooks/gmail-ops.test.ts src/hooks/gmail-watcher.test.ts src/process/command-error.test.ts src/infra/git-exec.test.ts src/shared/config-eval.test.ts src/skills/loading/config-binary.test.ts
node --import ./scripts/tsx.mjs scripts/check-tsgo-core-boundary.mts
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.plugins-platform.json --noEmit
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.services.json --noEmitThe full focused group passed 130 tests in eight files/five sequential shards before the final mechanical rebase. The utility 31 rerun, root guard, and owning typecheck passed after it. Historical capacity proof was 721/720 red → 720 green; the subsequent reconciliation guard assigned all 7,752 roots exactly once with 648/720 in the owning shard. After the final mechanical rebase, the guard passed again with 7,760 canonical roots assigned exactly once and 648/720 in the owning shard. No cap was raised. Formatting, lint, and applicable guards passed. Brave and OpenShell: the exact Brave test patch from The corrected owning extension-misc shard passed 68 files/1,259 tests, including Brave 33, OpenShell 13, OTEL and Searxng. Exact command: OPENCLAW_VITEST_MAX_WORKERS=2 \
OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/gmail-brave-fix-r95c4pcv/fs-cache \
NODE_OPTIONS='--import /tmp/gmail-brave-fix-r95c4pcv/shard-offline-preload.mjs' \
sandbox-exec -f /tmp/gmail-brave-fix-r95c4pcv/loopback-verified.sb \
node scripts/run-vitest.mjs run \
--config /tmp/gmail-brave-fix-r95c4pcv/vitest.config.ts
node scripts/check-changed.mjs -- \
extensions/brave/src/brave-web-search-provider.test.ts \
extensions/openshell/src/mirror.test.tsThis was macOS 27/Node 26.7 proof with a task-only offline DNS preload and sandbox, not Linux/Node 24 CI or an unmodified environment. The temporary config imports the current repository shard configuration, retaining non-isolation, two workers, and deadlines. An earlier sandbox incorrectly denied intended loopback and its 34 failures are not counted as green. The corrected profile was behaviorally verified with owned IPv4/IPv6 listeners, blocked numeric non-loopback destinations, and equivalent protected-port rules exercised only on owned ports. The actual operator Gateway port was never probed; no host ACL changed. Local evidence: Isolated Codex P0 reviews passed, no actionable findings, before the meaningful Gmail resolution and Brave/OpenShell commits. Normal reviewer sandbox/credential scanning remained intact. The final rebase preserved those patches except upstream temp-helper/import integration; no redundant review of unchanged bytes was run. Historical CI 33158612333 had 166 success/16 skipped/2 failed jobs: Brave's cancellation/cache shard and the consequential aggregate. Root/dependency/dead-export/types passed there, but those are not new-head gates. A previous local Knip 600-second timeout is not a pass. The old conflict and Brave failure are repaired locally; fresh hosted CI remains mandatory. No historical Gateway Testbox or native 18-test result is presented as proof of this patch. The latest ClawSweeper reconciliation/capacity requests are addressed; green exact-head CI and parent merge verification remain. One review-only refresh was already requested for the added test surface: #131502 (comment). No repeat request for the mechanical lint cleanup. Canonical native work remains separate in #131409. No live Gmail/provider credentials or operator Gateway resources were used. The subsequent CI33164713331 on Ingress lint cleanup, commit The same type-aware lint command failed at 703 and passed at 697. Core types, format/diff, and 85 tests/nine files passed in 14.22s; fresh isolated Codex P0 review passed with no findings and normal sandbox/credential scanning. Installed Node AbortSignal types and native getter behavior were checked for boolean equivalence. Exact commands: node scripts/run-oxlint.mjs --type-aware --tsconfig config/tsconfig/oxlint.core.json src/channels/message/ingress-drain.ts
node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo
OPENCLAW_VITEST_MAX_WORKERS=16 node scripts/run-vitest.mjs src/channels/message/ingress-drain.test.ts src/channels/message/ingress-drain.cancellation.test.ts src/channels/message/ingress-drain.debounce-failure.test.ts src/channels/message/ingress-drain.watchdog.test.ts src/channels/message/ingress-drain-lanes.test.ts src/channels/message/ingress-drain-lifecycle.test.ts src/channels/message/ingress-drain-supersede.test.ts src/channels/message/ingress-retry-policy.test.ts src/channels/message/ingress-monitor.test.tsLocal evidence: Final exact-head CI: run33166000417, head The rollup watcher separately encountered a cancelled ClawSweeper Dispatch job98831770304. That was auxiliary review publishing, not a CI payload failure; another dispatch succeeded and no repeated review request was posted. The latest actual review 5448425746 (10:55 UTC, on 9d2de7b) rates 5/6, finds no blocking correctness/security defect, independently passes both fake-command subprocess fixtures, and lists no Before merge source items. The subsequent mechanical ingress cleanup has its fresh P0 review. Final landing remains the parent's decision; prepare/merge have not run. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 7:17 AM ET / 11:17 UTC. ClawSweeper reviewWhat this changesRoutes Gmail setup and watch-registration failures through shared bounded diagnostics, adds subprocess and decision-path regressions, and includes small test and CI-documentation corrections. Merge readinessThe branch is technically sound on the reviewed head: Gmail setup and watcher failures now use the shared bounded formatter while preserving existing setup, provisioning, and renewal decisions. No introduced correctness or security defect was found; keep it open for exact-head CI and an authorized maintainer landing decision. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherGmail setup and the Gmail watcher run local helper commands, then surface failures to operators through setup errors or logs. The shared process formatter turns their command results into bounded, readable diagnostics without changing the command outcome. flowchart LR
A[Gmail setup or watcher] --> B[Local helper command]
B --> C[Command result]
C --> D[Shared diagnostic formatter]
D --> E[Setup error or watcher log]
E --> F[Operator troubleshooting]
Decision needed
Why: The protected maintainer label and incomplete exact-head CI require an authorized human landing decision rather than automated closure or merge. Before merge
Agent review detailsSecurityNone. PR surfaceSource -31, Tests +321, Docs +2. Total +292 across 12 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single shared formatter and land only after required exact-head CI is green, preserving the existing Gmail decision paths and focused regression coverage. Do we have a high-confidence way to reproduce the issue? Yes: the integration fixture runs Gmail setup against temporary fake gcloud and gog executables, drives login and watch failures, and verifies bounded readable errors with unchanged config; it needs no Gmail credentials or cloud resources. Is this the best way to solve the issue? Yes: reusing the shared process formatter removes Gmail-specific rendering while leaving each caller's established success, auth, provisioning, and renewal decisions intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 640d73e3d452. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
cf85191 to
5447698
Compare
The in-flight cancellation fixture polled for fetch within one second, but first-use runtime and DNS preparation can exceed that deadline. The first case then exited without aborting or awaiting its request, leaking it into the next case's global fetch mock (CI run 33118704789). Abort from the existing mocked transport after its listener is registered, await terminal rejection, and retain exact call-count and aborted-signal assertions. No production behavior, timeout, or SDK mock changes. (cherry picked from commit 697040a81eeb26a8ea947cec01b544125c3d98c0)
The wrapper's canonical macOS temp root makes the nested socket fixture exceed the 104-byte sockaddr_un.sun_path field, failing at listen before mirror reconciliation. Shorten the existing temporary-directory prefix without changing the socket name, assertions, cleanup, or production code.
5447698 to
9d2de7b
Compare
|
@clawsweeper re-review The Gmail utility conflict is reconciled with real binary probes preserved and the unchanged root cap passing. Head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* fix(gmail): keep setup command failures readable * test(gmail): consolidate setup diagnostics coverage * docs(ci): clarify Swift test execution policy * test(brave): cancel requests at the transport boundary The in-flight cancellation fixture polled for fetch within one second, but first-use runtime and DNS preparation can exceed that deadline. The first case then exited without aborting or awaiting its request, leaking it into the next case's global fetch mock (CI run 33118704789). Abort from the existing mocked transport after its listener is registered, await terminal rejection, and retain exact call-count and aborted-signal assertions. No production behavior, timeout, or SDK mock changes. (cherry picked from commit 697040a81eeb26a8ea947cec01b544125c3d98c0) * test(openshell): keep mirror socket fixtures within platform limits The wrapper's canonical macOS temp root makes the nested socket fixture exceed the 104-byte sockaddr_un.sun_path field, failing at listen before mirror reconciliation. Shorten the existing temporary-directory prefix without changing the socket name, assertions, cleanup, or production code. * refactor(channels): reuse ingress stop guard
Closes #131478.
Problem and repair
Gmail setup and watch-registration failures could bury useful details in progress output, omit stdout, or lose the subprocess termination reason. The separate Tailscale formatter kept the beginning of output and discarded the final diagnostic.
This moves Gmail failures to the existing process-owned formatter from #131420. It preserves bounded, labeled tails from both streams, normalizes ANSI/progress output without splitting UTF-16 pairs, and records exit/signal/termination metadata. Safe operation labels do not echo argument vectors; invalid-JSON errors retain their cause. Successful output, auth/install fallback, provisioning, and watcher retry decisions remain unchanged. Command output can still contain sensitive information and must be redacted before sharing.
CI repairs included
The Gmail diagnostic cases share the existing utility root rather than adding a root beyond the unchanged 720 cap. All 31 utility cases remain. The real binary-availability cases from #131617 use the actual filesystem/cache owner; only diagnostics and decision cases install a scoped owner spy. The subsequent temp-helper change from #131712 is preserved.
Two small test-only repairs address failures exposed while validating this PR:
697040a81eeb26a8ea947cec01b544125c3d98c0, coordinated with fix(gateway): preserve pending config restarts across repeated writes and reverts #128127. Its unrelated Gateway changes are not included. The old one-second poll could abandon a request during DNS/runtime preparation and leak it into the next test's fetch mock. Existing deadlines, SDK mocks, and assertions remain unchanged.sun_pathfield. Only the prefix and an explanatory comment change; production behavior and assertions do not.The next exact-head run exposed an inherited core-ingress lint failure (703 counted lines against 700). The approved cleanup reuses the existing
isStopped()owner in three adjacent catch guards, preserving disposal/abort/settled short-circuit order and the unchangedfinallyrelease. It removes six production lines without changing queue, retry, cancellation, or timing policy. The identical type-aware lint command changed from failure to success at 697 lines; 85 tests across nine ingress/lifecycle/monitor files, core types, formatting, diff checks, and a fresh isolated Codex P0 review passed. All eleven earlier PR files are byte-identical to the previously published head.The native pipe-test repair is tracked separately in #131409; our duplicate native test change was dropped. Only the CI documentation correction remains: one Swift invocation, parallel on automatic first attempts and serial on manual dispatches/reruns. Gateway repairs are owned upstream by #131515, #131545, and #131625. There is no Gateway or native source/test delta here, and no dependency, configuration, persistence, or cleanup-authority change.
Evidence
The original Gmail reproduction had 15 intended failures. Real-subprocess setup fixtures execute fake gcloud/gog binaries in isolated temporary state: login/watch failures retain both tails and termination metadata in 903/907-character errors, without writing config. ClawSweeper independently passed both fixtures. No authenticated Gmail, real login, or cloud-resource test is claimed.
The reconciled focused group passed 130 tests across eight files: utility 31, integration 2, operations 16, watcher 22, formatter 4, Git 37, shared binary owner 17, and skill-loading sibling 1.
The naive global-mock merge failed both real-probe cases; the scoped spy passed them. Substituting the actual pre-cache-fix owner made the creates-binary case fail again, with the missing-binary control passing; current production bytes were restored exactly. The 130-test proof predates the final mechanical import reconciliation with #131712; a fresh 31/31 utility run passed afterward.
Historical root proof was 721/720 red → 720 green. The later 130-test snapshot passed the actual guard with 7,752 roots assigned exactly once, owning shard 648/720, with no cap increase. Targeted owning types, formatting, lint, and guards passed. After the final mechanical rebase, the actual root guard passed again with 7,760 canonical roots and 648/720 in the owning shard; the owning typecheck also passed.
Brave's independently released 2,500ms DNS fault gave 3 failed/30 passed → 33 passed, with no request reaching a later mock after repair. OpenShell gave 1 failed/12 passed → 13 passed, reducing the observed socket path from 114 to 100 bytes. The corrected full extension-misc shard passed 68 files/1,259 tests on macOS 27/Node 26.7, preserving the repository's non-isolated execution and two workers. This used a task-only offline DNS preload and a verified sandbox permitting intended loopback while denying external network and the operator Gateway port; it is not an unmodified environment or Linux/Node 24 CI. An earlier task sandbox incorrectly denied intended loopback and that failed run is not counted as green. Exact scoped commands and local evidence bindings are in the existing proof comment.
Fresh isolated Codex reviews passed at P0 scope, with no actionable findings, before the meaningful Gmail resolution and the Brave/OpenShell commits. Review isolation and credential scanning remained intact. The final rebase changed only the upstream temp-helper/import integration; other commit patches and retained production/test bytes were verified unchanged.
Publication and gates
Head
a350a364e8f188d6d47bb4305bfb67c81748a981; base4d9187a6187447c7c6cbc316cbc2cd778ba1dd9b; tree0a498b62950457e894d1d3511b15c5e262fea024. 12 files: production +40/-71 (net −31), tests +413/-92 (net +321), docs +3/-1.Historical CI run 33158612333 failed the Brave shard and consequential aggregate gate; its root, dependency/dead-export, and type gates passed. The Brave failure is repaired locally as described above. A prior local Knip run reached its unchanged 600-second deadline and is not a pass.
Previous exact-head CI33164713331, on
9d2de7b239e637f26f7fa1012f62fe62ca4671d5, finished with 166 successful, 16 skipped, and 2 failed jobs: core lint and its aggregate gate. The previously failing Brave extension-config-5 job passed. The lint failure atsrc/channels/message/ingress-drain.ts:823:2is addressed by the reviewed stop-guard cleanup above; no limit, suppression, or assertion changed.Fresh exact-head CI passed: run33166000417 on
a350a364e8f188d6d47bb4305bfb67c81748a981completed with 168 successful jobs, 16 skipped, and zero failures; all 184 jobs are terminal. The aggregate gate98834714134, core-lint-4, and previously failing Brave extension-config-5 jobs passed. No prepare or merge has run. ClawSweeper's real-probe reconciliation/capacity requests are addressed. The single review-only refresh was already requested for the added test surface; this mechanical lint cleanup does not trigger another request. The latest actual ClawSweeper review (10:55 UTC, 5/6) found no blocking correctness/security issues and lists no remaining source changes. The mechanical ingress cleanup has its own clean P0 review. Parent merge verification remains required.AI-assisted with Codex. No transcripts, live credentials, or operator resources are included.