Skip to content

test(e2e): report the inspect command outcome when the built-CLI proof fails - #136478

Merged
steipete merged 1 commit into
mainfrom
codex/perf4-cli-command-capture
Sep 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf4-cli-command-capture

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Related: #136211, #136391, #136434

What Problem This Solves

Fixes an issue where the built-CLI SQLite lifecycle proof (test/scripts/sqlite-sessions-transcripts-flip-proof.built-cli.e2e.test.ts) reported an unreadable failure when the built CLI could not inspect the bundled OpenAI plugin: the thrown message carried only a "Gateway diagnostics" block, which is always empty at that point because the Gateway has not started. CI readers of main runs 33636023408 and 33642826781 and PR run 33638802946 (2026-09-02) saw exactly that empty block and nothing about the command that failed.

The original version of this PR also repaired the shared test-instance cli() capture, which silently dropped the head of plugins list --json once #136211 grew that payload past the 256 KiB log-tail buffer. That owner repair has since landed on main in #136434 (a8fe1a587bb: head-captured stdout, loud overflow failure, tail-bounded stderr, complete/overflow regression cases), so this PR is reduced to the residual the proof still lacked.

Why This Change Was Made

Record the fact where it happens: when the inspect command fails or returns an unexpected shape, the proof now throws with the command's exit code, signal, and bounded stdout/stderr tails. The comment no longer claims a log-tail bound applies to command results; the proof inspects one plugin because that is the provider it exercises.

User Impact

No user-facing behavior change. The next failure of this proof names the built-CLI command outcome instead of an empty Gateway log.

Evidence

  • Head is a single six-line change on top of main (test support +6/-2, production LOC 0).
  • Previous heads of this PR (7c59edd, 1e58d65, 92ffaa5ff57) carried the now-superseded capture repair; on 7c59edd the build-artifacts job ran the sqlite lifecycle verifier against the original plugins list --json path and passed in 42 s (run 33661564208), and 92ffaa5ff57 had a fully green exact-head run (33675679586, attempt 2 after two Blacksmith runner drops).
  • Root-cause measurement on a full source build: plugins list --json is 296,257 bytes with dependencyStatus and 226,390 bytes without, against a 262,144-byte cap; all 151 plugins in a source checkout are bundled-origin and 90 gained dependencyStatus in fix(plugins): channels.<id>.enabled=false no longer loads the channel plugin when its plugin entry is enabled #136211.
  • Exact-head CI for this head is linked in the landing comment.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review September 2, 2026 17:31
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 4:32 PM ET / 20:32 UTC.

ClawSweeper review

What this changes

The PR adds bounded exit-code, signal, stdout, and stderr diagnostics when the built CLI plugin-inspection check fails.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: current main has the shared CLI-output capture repair, but it still emits the terse pre-Gateway inspection failure this PR improves. No introduced correctness defect found; coordinate the overlapping diagnostic work with #136286 before merge.

Priority: P2
Reviewed head: 9314dcf971f339f000eaf96ef93841a120884284
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is narrowly scoped and correct, with only the maintainer-owned overlap decision remaining.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored, internal test-support PR does not change user-visible behavior; the ordinary external-contributor proof gate is not applicable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored, internal test-support PR does not change user-visible behavior; the ordinary external-contributor proof gate is not applicable.
Evidence reviewed 6 items Introduced diagnostic: The only introduced hunk records the failed inspection command's code, signal, and bounded stdout/stderr at the exact predicate that rejects the artifact.
Current-main helper boundary: Current main routes CLI calls through the managed UTF-8 command runner, preserves machine-readable stdout, bounds stderr diagnostics, and throws on stdout overflow; the residual PR does not alter that shared owner.
Current-main gap: Current main already uses the narrow OpenAI inspection but retains the old generic error, so it does not yet expose the inspection outcome when that assertion fails.
Findings None None.
Security None None.

How this fits together

The SQLite lifecycle proof invokes the built CLI before a Gateway starts, verifies the bundled OpenAI plugin artifact, then continues into the Gateway lifecycle scenario. This change makes a failed pre-Gateway verification useful to CI readers.

flowchart LR
  A[Built CLI lifecycle proof] --> B[Inspect bundled OpenAI plugin]
  B --> C{Artifact is valid}
  C -->|Yes| D[Start Gateway lifecycle]
  C -->|No| E[Capture command outcome]
  E --> F[Bounded CI failure report]
Loading

Decision needed

Question Recommendation
Should this residual producer-side diagnostic land independently, or be folded into the related shared CLI repair at #136286? Keep this residual standalone: Merge this narrowly scoped diagnostic after confirming the related helper PR does not carry an equivalent report.

Why: Both open PRs describe work at the same CLI inspection boundary, and the prior review's requested canonical-scope decision is not yet resolved by the available evidence.

Before merge

Agent review details

Security

None.

PR surface

Tests +4. Total +4 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 6 2 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 6 2 +4

Review metrics

Metric Value Why it matters
Production versus test support production +0/-0; test support +6/-2 The patch is confined to a bounded failure message and comments, with no runtime product-code growth.

Merge-risk options

Maintainer options:

  1. Align the two CLI-proof changes (recommended)
    Confirm which PR owns the residual inspection diagnostic and retain one tested implementation before merge.
  2. Fold the residual into the broader repair
    If the broader helper repair already includes an equivalent producer-side report, close this branch after that implementation is validated.

Technical review

Best possible solution:

Retain one producer-side report for the failed inspection and integrate it once against the canonical shared CLI helper, then run the built-CLI lifecycle proof on that combined result.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: make the built CLI inspection return a nonzero or unexpected JSON shape, and the current-main catch path pairs its generic error with an empty pre-Gateway log. The supplied discussion also records observed failures at that boundary.

Is this the best way to solve the issue?

Yes: the command outcome is recorded at the failing inspection producer, while the shared CLI runner remains responsible for capture limits and command lifecycle.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cc2b9057d832.

Labels

Label justifications:

  • P2: This improves diagnosability of a built-CLI lifecycle proof without changing product runtime behavior.
  • merge-risk: 🚨 other: A related open PR changes the same CLI proof boundary, so an explicit integration scope is needed to avoid duplicate test-support behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored, internal test-support PR does not change user-visible behavior; the ordinary external-contributor proof gate is not applicable.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-02T17:38:51.875Z sha 7c59edd :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T18:43:32.905Z sha 1e58d65 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T19:58:28.136Z sha 92ffaa5ff57830ae1aa3a7976165fde0eaa3c1f9 :: needs maintainer review before merge. :: none

@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Independent corroboration from the seven-day dependency refresh: its exact-head hosted build-artifacts job failed at the same pre-Gateway plugin inventory boundary.

On that candidate (672f7f4eafce1bb8f8dec2c3ceb66c0abb008f6c), an isolated actual built-CLI comparison returned exit 0, no stderr and valid 301,907-byte JSON with 151 plugins. The instance helper instead returned a 262,184-byte diagnostic tail, including its truncation prefix, which could not parse. The unchanged complete SQLite built-CLI test reproduced the same inventory error locally. No SQLite or Gateway scenario had started at the failure boundary.

We are holding our independently developed local capture patch unpublished so this repair can remain canonical. The broader complete-output/CLI-lifetime repair also changes this owner; those two implementations need coordination before integration. Our receipts corroborate the defect, not a passing run of either proposed repair. After the canonical fix lands, the dependency PR will rerun the owning proof on its integrated candidate.

@steipete
steipete force-pushed the codex/perf4-cli-command-capture branch from 7c59edd to 1e58d65 Compare September 2, 2026 18:33
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 2, 2026
@steipete steipete self-assigned this Sep 2, 2026
@steipete
steipete force-pushed the codex/perf4-cli-command-capture branch from 1e58d65 to 92ffaa5 Compare September 2, 2026 19:50
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Sep 2, 2026
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready summary (maintainer landing via scripts/pr).

Root cause and trigger. #136211 started reporting dependencyStatus for externally distributed bundled plugins, which in a source checkout grows openclaw plugins list --json from 226,390 to 296,257 bytes, past the shared test-instance helper's 262,144-byte log-tail buffer that cli() reused for command results. The truncated JSON lost its head silently and the built-CLI SQLite lifecycle proof threw with empty Gateway diagnostics on main runs 33636023408 and 33642826781 (Blacksmith) and PR run 33638802946 (GitHub-hosted ubuntu-24.04), all with the step finishing in about two minutes, so no runner incident was involved. #136391 narrowed the proof to plugins inspect; this PR repairs the owner so every --json consumer of cli() gets complete output or a loud overflow failure.

Head 92ffaa5ff57 is a rebase of 1e58d65 onto main 2c2e501 with an identical patch-id (90d734a18c20); no main commit since the previous base touched the three files. The two red checks on the previous head were main-inherited and already fixed on main: check-lint-core-1 (max-lines in src/cli/gateway-backed-exit.process.test.ts, fixed by aef65cc) and checks-node-compact-large-30 (corner-shape.browser.test.ts, fixed by #136402).

Proof.

  • Exact-head CI run 33675679586 (attempt 2 after two Blacksmith 8-vCPU shards were dropped without logs and rerun; 98 passed, 32 skipped, 0 failed) on 92ffaa5ff57: green.
  • Patch-identical head 7c59edd: build-artifacts ran the sqlite lifecycle verifier on the original plugins list --json path and passed in 42 s (run 33661564208).
  • Codex autoreview (gpt-5.6-sol, high) of 92ffaa5ff57: scoped-clean, no accepted findings, patch correct (0.98).
  • ClawSweeper review of 1e58d65: no findings, ready for maintainer look; the rebase is mechanical, so no re-review was requested.
  • Runner contract read: test/helpers/run-node-script.ts captures both streams through managed completion with the 16 MiB per-stream maxBuffer from resolveMaxOutputBytes, aborts on overflow with ERR_CHILD_PROCESS_STDIO_MAXBUFFER, and the managed timeout error text still matches the helper's command timed out after <ms>ms assertion.

Known gaps. Local Windows execution of the new POSIX-only signal case was not run here; the case is platform-gated in the test.

…f fails

When the built-CLI SQLite lifecycle proof cannot inspect the bundled
OpenAI plugin, the Gateway has not started yet, so the failure's
"Gateway diagnostics" block is always empty and CI readers learn nothing
(main runs 33636023408 and 33642826781, PR run 33638802946 on
2026-09-02 all reported an empty block). Carry the inspect command's
exit code, signal, and stdout/stderr tails in the thrown error instead.

Also drop the comment claiming a log-tail bound applies to command
results: #136434 made `cli()` return complete stdout and fail loudly on
overflow, so the proof inspects one plugin only because that is the
provider it exercises.

Residual of the original #136478 change after #136434 landed the
shared command-capture repair on main.
@steipete
steipete force-pushed the codex/perf4-cli-command-capture branch from 92ffaa5 to 9314dcf Compare September 2, 2026 20:24
@steipete steipete changed the title test(e2e): preserve complete CLI command output test(e2e): report the inspect command outcome when the built-CLI proof fails Sep 2, 2026
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready summary for the rewritten head (maintainer landing via scripts/pr).

Why this PR shrank. While it was open, #136434 (a8fe1a5) landed the shared cli() capture repair on main: stdout is captured from the head, overflow fails loudly, stderr stays tail-bounded, the duplicate signal dispatcher is gone, and complete/overflow regression cases exist. That is same-or-better than the runner consolidation this PR carried, so the head 9314dcf keeps only the residual the proof still lacked: the inspect failure now reports the command's exit code, signal, and bounded stdout/stderr tails, and the comment no longer claims a log-tail bound applies to command results.

Proof.

  • Exact-head CI run 33679136751 on 9314dcf: green (see check list).
  • Codex autoreview (gpt-5.6-sol, high) of 9314dcf: scoped-clean, no accepted findings, patch correct (0.99).
  • Original root cause and trigger, for the record: fix(plugins): channels.<id>.enabled=false no longer loads the channel plugin when its plugin entry is enabled #136211 grew plugins list --json in a source checkout from 226,390 to 296,257 bytes, past the 262,144-byte tail cap; the failing runs 33636023408 and 33642826781 (Blacksmith) and 33638802946 (GitHub-hosted) all completed the step in about two minutes, so no runner incident was involved. Previous heads of this PR proved the capture repair end to end: 7c59edd passed the sqlite lifecycle verifier in build-artifacts (run 33661564208, 42 s) and 92ffaa5ff57 had a fully green exact-head run (33675679586).

Known gaps. None for this six-line change; production LOC 0, test support +6/-2.

@steipete
steipete merged commit a0af72e into main Sep 2, 2026
135 of 137 checks passed
@steipete
steipete deleted the codex/perf4-cli-command-capture branch September 2, 2026 20:48
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…f fails (openclaw#136478)

When the built-CLI SQLite lifecycle proof cannot inspect the bundled
OpenAI plugin, the Gateway has not started yet, so the failure's
"Gateway diagnostics" block is always empty and CI readers learn nothing
(main runs 33636023408 and 33642826781, PR run 33638802946 on
2026-09-02 all reported an empty block). Carry the inspect command's
exit code, signal, and stdout/stderr tails in the thrown error instead.

Also drop the comment claiming a log-tail bound applies to command
results: openclaw#136434 made `cli()` return complete stdout and fail loudly on
overflow, so the proof inspects one plugin only because that is the
provider it exercises.

Residual of the original openclaw#136478 change after openclaw#136434 landed the
shared command-capture repair on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant