Repository navigation
fix(update): name the failure cause in generated reports without exposing private data - #178301
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de41c2258c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| activeCheckStep = startupDiagnostics.failure( | ||
| currentStep(running.child.exitCode || 1), | ||
| running.child.signalCode, | ||
| error instanceof readiness.UpdateCandidateReadinessTimeoutError, | ||
| ); |
There was a problem hiding this comment.
Finalize startup facts after pipe flushing
When a candidate exits nonzero before its stdout/stderr pipes close—especially when a child inherited those pipes or the final diagnostic has no trailing newline—launchCanary.result resolves on exit, but buffered lines are only delivered by the flushers on close. Calling startupDiagnostics.failure() here therefore freezes activeCheckStep before those recognized config/plugin/native-module diagnostics are observed; stopCanary() may flush them afterward, but the generated report still falls back to a generic failure. Preserve the natural signal/timeout here, then finalize the collected facts after teardown has flushed the streams.
AGENTS.md reference: AGENTS.md:L73-L76
Useful? React with 👍 / 👎.
|
Compressed the implementation at 9d51c9c; evidence and the production-block accounting are current in the PR body. The startup pipe-flush finding is fixed with a failing-before/passing-after regression. The new privacy-test identifiers and credential examples are synthetic fixtures. The isolated automated review returned incomplete because its chunks omitted callers. Its producer-path findings were checked against the complete CLI/Gateway submission flow: local facts retain concrete keys, while the public renderer schema-projects every affected key before submission. The end-to-end privacy tests cover that boundary; the review limitation and disposition are recorded in Evidence. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Updated at edefdf6. Restored the existing public facts, removed the schema dependency from the trusted wrapper closure, and refreshed Node/Bun evidence plus inherited-failure notes in the PR description. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…sing private data (openclaw#178301) Refs openclaw#178094, openclaw#178244, openclaw#145390. Generated update-failure reports collapsed candidate-startup failures to [redacted-diagnostic] and config paths to agents.*, leaving them untriageable. The candidate canary now emits fixed producer-owned cause templates and invalid-config reports keep schema-owned path segments with <id> for dynamic map keys; existing allowlisted facts are preserved. The openclaw#145390 public allowlist is unchanged: no free-text diagnostics, paths, hosts or user values reach the public report.
…sing private data (#178301) Refs #178094, #178244, #145390. Generated update-failure reports collapsed candidate-startup failures to [redacted-diagnostic] and config paths to agents.*, leaving them untriageable. The candidate canary now emits fixed producer-owned cause templates and invalid-config reports keep schema-owned path segments with <id> for dynamic map keys; existing allowlisted facts are preserved. The #145390 public allowlist is unchanged: no free-text diagnostics, paths, hosts or user values reach the public report. (cherry picked from commit f642756) Release adaptation: preserve named canary imports, rehearsal cleanup, current release fixture isolation and TypeScript API. Carry the schema-path callback through the release report context type and adapt the startup fixture to the release rehearsal preparation contract. The bundled build Git-root guard and relocated-package isolation are already covered. Adapt compatibility discovery to exclude the two existing sealed helper entrypoints; do not import the later standalone-graph registry. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]> (cherry picked from commit 1898acb4d7017f51e7e765500c563edabd44ce23)
What Problem This Solves
Generated update failure reports hide actionable candidate startup causes and collapse config fields, leaving reports such as #178094 and #178244 difficult to triage.
Refs #178094, #178244, #145390.
User Impact
Reports name recognized startup causes such as
plugin load failed: discord,port in use, schema migration, native-module failures, readiness timeout, and process signals. Config errors retain schema vocabulary, for exampleagents.entries.<id>.model.primary: expected string, got number. Unknown plugin IDs, arbitrary keys, rejected values, and free-text diagnostics remain private.Why This Change Was Made
The #145390 allowlist is an intentional privacy boundary. The canary now records fixed facts before rolling logs or cleanup can obscure them, reusing the existing
candidate-startup-failedcode. One fixed condition/template table serves capture and public admission. Config projection uses the existing core-schema classifier and existing key-redaction owner. The report projects each fact once and reuses it for summary and detail. The report exporter injects schema classification into shared redaction, keeping the trusted PR wrapper import closure free of the config-schema graph. The phase summary retains existing allowlisted stderr facts before adding fixed producer facts.The compression removes the standalone startup classifier, config adapter module, extracted type-only module, duplicate config/startup report projections, redundant code registration, and the second union-issue mapper. Existing canary types live beside the command type they describe; no new cause model or failure-fact shape is introduced. The existing private diagnostic contract remains intact.
Evidence
The held-head CI failures were traced to three regressions: config projection treated the existing package field
engines.nodeas an unknown config key; removing the free-text error-name bypass also lost fixed transaction/pipe causes; and shared redaction imported the config-schema lookup outside the trusted PR wrapper inventory. This revision restores the exact engine field and closed phrases (attempt state write refused,sentinel transaction refused,sentinel transaction unavailable,pipe closed) without restoring arbitrary prose. Schema projection is injected by the exporter. Both eager import-closure checks and the previously failing ordinary provisioning cases pass.The consumer sweep also caught a structured startup fact displacing existing stderr facts. The new regression fails before the repair:
plugin load failed: discordhidesEACCES; Permission denied. Summaries now merge and deduplicate sanitized components within the existing 200-byte bound. The exact-template shortcut accepts only a single physical line, so it cannot discard later stderr lines.The 55-file report/triage/wrapper consumer selection ran on both Node and Bun. The final focused Node replay passes 201 tests across seven files, including the CLI runtime-fact handoff, campaign persistence/transfer failures, all public redaction cases, and the candidate startup cases. The final Bun sweep passes 1,033 tests, with one platform skip and two failures: the inherited APFS timeout described below, and an exact startup expectation that still expected only the config field. That expectation now explicitly requires both the retained generic config fact and the schema path; all 16 startup cases pass on Node and Bun after the update. Separately, all 151 report/redaction tests pass on both runtimes.
Core types, strict scoped test types, lint and formatting on the changed files,
git diff --check, and Madge (0 cycles) pass. The final isolated five-file review completed with no actionable P0–P2 findings. The earlier Node discovery failures from missing CommonJS fixture receipts and dropped fixed causes are resolved; the final targeted replay is green. Intermediate runs invalidated by source changes were discarded and the final proofs use a frozen source revision.The existing CLI subprocess group passes all 21 tests on both runtimes (Node 124.52s, Bun 160.34s); its serial real-process/timeout fixtures account for the measured cost. The full
check:changedSQLite inventory remains omitted under the campaign's local gate budget; no baseline, timeout, or assertion was weakened.The UI failure is inherited from the CI merge base:
7a0c15b15693intentionally retained header rename during reconnect, while the old test expected detachment. Main fixes that assertion in80afbe1b7950116b6d55c557c7c7d4bc5fd01330. This branch has no UI diff; the complete five-case file passes on both Node (25.99s) and Bun (21.13s). An initial setup attempt could not find Chromium under the isolated HOME; using the existing Playwright binary cache with fresh test profiles resolved setup without changing product code.The worktree-local temp root initially made CommonJS triage fixture children inherit the repository's ESM package scope, causing eight missing receipt files. A minimal Node probe reproduced
require is not defined in ES module scope; a private temp-rootpackage.jsonwithtype: commonjsrestores the same package scope as the usual OS temp directory. This is proof setup only, not a repository change.The cold/warm APFS provisioning case has an inherited local timing failure: 161.430s on Node against its existing 120s limit. It runs six real wrapper invocations serially; the preceding single-invocation cases average 21.777s, so six already exceed 130s. Its test, fixture, and provisioner are unchanged from main. No timeout or assertion was relaxed. Bun reproduces the same unchanged local timeout at 150.426s.
Earlier compression validation: the 18-file consumer run passed 812 tests and exposed three relocated-package fixture failures; those three cases now pass after enforcing the fixture's dependency boundary (6.82s wrapper, 5.85s test file). One existing platform case was skipped. All report, config, Gateway and canary cases passed, including 119 canary cases, 86 config/report cases, and 44 Gateway report cases.
The new unterminated-stderr regression fails without the fix: a recognized plugin cause becomes
[redacted-diagnostic]. Attaching the captured facts after pipe closure makes it pass. The original config/startup regressions also failed against the original producers. Privacy tests retain token, email, path, host/IP, credentialed URL, phone, dynamic-key and arbitrary-prose coverage.Core types, strict scoped test types (with the repository's
allowJssetting), lint, formatting on all 32 changed files,git diff --check, and Madge (0 cycles) pass. The first expanded temporary test config omittedallowJsand rejected existing.mjsimports; correcting that config resolved the setup error without source suppressions.The earlier compression review at
9d51c9c8completed 40 passes but returned incomplete because its file chunks omitted cross-file context; this is not a clean automated verdict. Its two P2 claims requested public schema projection inside the local config-fact producers. Both were rejected after tracing the complete path: local facts intentionally retain scrubbed concrete keys, andupdate-failure-report-prepare.tsschema-projects every affected key before either CLI or Gateway submission. The validator-to-public-report privacy tests cover that boundary. A separate full-context read-only review found no actionable issue. The GitHub review's unterminated-stderr finding is fixed and has a red/green regression.The five build-dependent suites previously stopped before execution because compatibility discovery treated two sealed recovery bundles as shared runtime chunks. The build owner now excludes their canonical entrypoint paths using its existing independent-graph set. Genuine shared-graph ambiguity still throws. Both new regression cases fail before the fix; all 19 tests pass after it (2.823s test time, 45.35s wrapper including compiled preparation).
Size: production +371 / -128 (net +243), tests/support +466 / -21, docs +7 / -0, against
f7908148d72e52c7deeca5520e1dfa71fa0c2655. The complete change removes 185 net production lines from the earlier net +428 proposal. This CI repair adds 21 net production lines to9d51c9c8while retaining the compression. The deleted adapter/classifier/type files account for 234 removed lines; the former report projection loses 90 lines, replaced by 49 lines sharing the existing fact projection.Remaining production blocks and why they are required
Net +243 remains above the requested ~150 target. This accounts for every remaining production hunk, including mechanical moves and formatting; none adds a new config, CLI, dependency, or storage contract.
scripts/lib/bundled-plugin-source-utils.mts+3/-0 andbundled-plugin-build-entries.mjs+3/-0.gituses filesystem discovery. This prevents a staged candidate under a parent checkout from inheriting an empty parentgit ls-filesresult and losing its plugin assets.scripts/lib/update-compat-chunks.mts+7/-1src/cli/update-cli/update-command-config-failure.ts+10/-5src/config/validation-issues.ts+12/-8model.primaryinstead of the enclosing model union. Binding-specific selection remains unchanged.src/infra/update-candidate-canary-commands.ts+32/-0 andupdate-candidate-canary.ts+62/-62src/infra/update-candidate-canary-process.ts+32/-1src/infra/update-candidate-canary-readiness.ts+5/-3TimeoutErrorname so the producer can distinguish timeouts from crashes. No new error class.src/infra/update-preflight-details.ts+27/-0src/infra/update-failure-facts.ts+23/-9apiKeydiagnostics as apparent secret assignments on a second normalization pass. Unknown prose keeps the existing private-only redaction path.src/infra/update-failure-report-prepare.ts+71/-29engines.nodeexception; projects each fact once; preserves the old sanitized aggregate before adding fixed field/message/plugin facts and deduplicates within 200 bytes. Distinguishes validator kinds from non-validation field errors; removes the duplicate renderer and error-name free-text bypass.src/logging/diagnostic-support-redaction.ts+84/-10<id>/<key>and retains the no-schema fallback. A closed validator-kind formatter/parser handles type, required and unrecognized-key issues, exposing only the known retiredapprovalPolicykey. Exact single-line startup templates and OS signals are admitted; the existing config-field branch uses the same parser. The closed cause list retains the four existing transaction/pipe phrases.Proof commands and limitations
All runtime/test commands used isolated
HOME,OPENCLAW_STATE_DIR, andTMPDIRbeneath this worktree's.artifacts/. No operator state or unrelated Gateway was touched.The previously blocked built-runtime selection was the original 13-file report/canary selection plus these five files:
legacy-config-migrate.e2e.test.ts,config-startup-corpus.test.ts,update-candidate-canary.integration.test.ts,openshell-agent-workspace.e2e.test.ts, andrequired-native-same-session.e2e.test.ts. Its real runtime preparation passed: tsdown 2m51.4s, external-plugin assets 13.4s, bootstrap guard 9.23s, copies 16.9s, runtime postbuild 13.7s. The first three suites passed; OpenShell is platform-skipped. The native-session suite started its isolated Gateway and installed the worker, then failed after 44.235s because workspace materialization rejects the worktree volume's inherited group-writable permissions. The trust check and mount permissions were not weakened.The real built candidate integration passed in 65.481s, including snapshot preparation, Doctor/config/plugin/runtime checks, Gateway startup/readiness, and reaping the candidate while the preoccupied sandbox listener remained up. This is an existing full-flow test, not a unit test starting a real update per case. The existing test-plan suite repeatedly evaluates repository-wide selections; the final tooling shard took 221.5s. The CLI-process consumer group previously passed 21 tests in 162.86s, dominated by separate CLI boots. These measured costs remain recorded; no timeout was increased.
Two existing build collectors previously inherited an ancestor checkout for staged, unpacked roots. Both now require their own
.gitmarker before using the Git inventory. A new nested-root regression fails without this guard. The no-scan tests permit only the exact root-marker probe and still reject every extension-directory scan. The three relocated grammar cases now reject dependencies resolved outside their copied package, retaining both the absent-native-grammar assertion and the real parse assertions.The full
check:changedSQLite inventory remains omitted under the campaign's local gate budget. PR CI is the broad authority. No baseline or timeout was increased and no test was skipped by this revision.CI repair runtime commands
All invocations use an isolated HOME, OPENCLAW_STATE_DIR, and TMPDIR inside this worktree. The private temp root declares CommonJS for synthetic executable fixtures; no repository package metadata changes.