Repository navigation
Conversation
Codex harness collectors omitted structured_output and still exposed native Bash despite OpenClaw allow-only policy. Force the collector tool surface, fail closed if it is missing, and disable the native tool surface for collector attempts. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d342d20b45
ℹ️ 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".
| // Collector children must not inherit Codex-native Bash/shell/file tools. | ||
| // OpenClaw config allow/deny alone is not a native-harness authority boundary. | ||
| if (isSwarmCollectorStructuredOutputAttempt(params)) { | ||
| return false; |
There was a problem hiding this comment.
Preserve allowed file tools for collector turns
For every schema-backed collector, this branch disables the entire native surface even when inherited policy allows workspace tools. The fallback in shouldKeepOpenClawShellDynamicTools preserves only exec/process, while extensions/codex/src/app-server/dynamic-tool-profile.ts:10-25 filters read, write, edit, and apply_patch as native-owned; therefore unrestricted collectors, or collectors explicitly allowed file access, start with environments: [] and no file tools, preventing code-investigation collectors from inspecting their workspace. Preserve policy-filtered dynamic file tools when forcing native mode off, or scope this disablement to collector-only allowlists.
AGENTS.md reference: AGENTS.md:L54-L54
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed August 21, 2026, 4:33 PM ET / 20:33 UTC. ClawSweeper reviewWhat this changesThe branch changes Codex Swarm collector tool handling and adds a macOS factory-controller gateway path with durable structured-result storage. Merge readiness⛔ Blocked until stronger real behavior proof is added - 13 items remain Keep this PR open for maintainer handling, but it is not merge-ready: it still exposes native Codex tools to production collectors, adds an unapproved factory control plane far beyond the stated fix, and lacks inspectable real-behavior proof. Priority: P1 Review scores
Verification
How this fits togetherSwarm starts collector subagents through the Gateway; the Codex app-server chooses their available tools and returns collector output to durable run state. This PR changes that execution boundary and adds a separate local factory controller that can launch and retrieve collectors. flowchart LR
A[Factory controller] --> B[Gateway collector RPC]
B --> C[Swarm collector run]
C --> D[Codex app-server tools]
D --> E[Structured result ledger]
E --> F[Result readback]
Decision needed
Why: That new control plane is not required to repair the stated missing structured-output behavior and creates a security, protocol, and persistence contract that cannot be selected mechanically. Before merge
Findings
Agent review detailsSecurityNeeds attention: The new credentialed factory path has no lifecycle cleanup for its writable per-run artifacts, while its app-server attestation contract remains unverified upstream. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land a narrow current-main Codex repair that forwards collector context, exposes the result tool through the effective policy, and preserves policy-allowed file tools; handle the factory RPC and persistence design separately after explicit ownership approval. Do we have a high-confidence way to reproduce the issue? Yes, from source: a Gateway-created schema-backed collector supplies the structured-output callback, which bypasses the PR's native-tool disable predicate when no explicit allowlist is present. Is this the best way to solve the issue? No: the branch still misses its confinement invariant and mixes the narrow collector defect with an unapproved factory-control-plane design; a focused current-main repair is safer. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3ea90bdcdb30. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
…port-v2 fix(factory): isolate restricted harness tools
|
I reproduced the original collector-output defect on a fresh main-derived build ( The focused repair and fresh evidence are tracked in the collector-tool handoff issue. It will preserve the existing collector contract and policy-allowed host file tools, including the relevant sibling harness path. Thank you @tmill313 for reporting the original gap here. The factory-controller RPC, credential, and durable-ledger proposal currently in this branch is a separate design surface. I am keeping that work untouched rather than mechanically merging or rewriting it as part of this bug fix. This comment is not approval of those additional contracts. |
Carry collector output and noninteractive policy through shared tool preparation. Register Copilot during discovery, initialize selected direct credentials, retain canonical session IDs, and preserve failed-turn errors. Keep retained catalog callbacks bound to their owner generation rather than an expired publication transaction. Cover the owner boundaries with failing/passing regressions and real native, Codex, and Copilot Gateway runs, including credential recovery and same-process worker-policy reloads. Reuse the native auth test fixture instead of reloading the complete runner in every case. Fixes #131552 Fixes #131580 Fixes #131591 Fixes #131699 Fixes #131700 Fixes #131701 Thanks to @tmill313 for the original Codex collector report in #120077.
…131739) * fix(agents): restore prepared collector and harness execution Carry collector output and noninteractive policy through shared tool preparation. Register Copilot during discovery, initialize selected direct credentials, retain canonical session IDs, and preserve failed-turn errors. Keep retained catalog callbacks bound to their owner generation rather than an expired publication transaction. Cover the owner boundaries with failing/passing regressions and real native, Codex, and Copilot Gateway runs, including credential recovery and same-process worker-policy reloads. Reuse the native auth test fixture instead of reloading the complete runner in every case. Fixes #131552 Fixes #131580 Fixes #131591 Fixes #131699 Fixes #131700 Fixes #131701 Thanks to @tmill313 for the original Codex collector report in #120077. * test(agents): keep collector proofs on owned boundaries Move real collector-tool and prepared-registry integration proof to core, retain independent plugin SDK handoff regressions, and select the host Copilot integration for plugin-only changes. Run the existing plugin-test core-import guard in changed-file checks so local validation catches the same boundary violation as CI. The replacement regressions fail against their pre-fix owners. All 505 focused tests, the exact import guard, and the changed-file gate pass. Independent review found no actionable P0-P2 findings. Runtime repair files are unchanged. * test(agents): load prepared harness through its public boundary Evaluate the real Copilot entrypoint through the existing public-surface loader and module-loader seam instead of importing plugin implementation into the core typegraph. Remove the synthetic entrypoint and registration global, while retaining real discovery and lazy-store assertions. Include the existing core tsgo graph boundary in changed-file checks and cover its ordinary and live-Docker routing paths. * test(mcp): seed canonical SQLite session history Use the installed candidate's public session APIs instead of creating legacy session files rejected by doctor-only startup. Preserve message IDs, parent ordering, delivery context, and canonical attachment metadata. Add a built-SDK fixture regression using real SQLite reads and startup validation. The full MCP client remains covered by the Docker CI lane. * test(gateway): preserve queued writes across RPC fixtures Stop clearing session writer queues before ordinary RPCs. Config fixtures still synchronize, while canonical writers retain their own cache updates. Prove queued-write ordering through a real connected Gateway against a raw WebSocket control, and dispose the custom test database before file removal. Preserve the underlying cause of the settlement timeout. That CI failure was not reproduced on the exact synthetic merge locally; the independent queue-reset defect is not being claimed as its established cause. * test(agents): keep harness fixture coverage on focused boundaries * test(imap): await committed watcher initialization
…penclaw#131739) * fix(agents): restore prepared collector and harness execution Carry collector output and noninteractive policy through shared tool preparation. Register Copilot during discovery, initialize selected direct credentials, retain canonical session IDs, and preserve failed-turn errors. Keep retained catalog callbacks bound to their owner generation rather than an expired publication transaction. Cover the owner boundaries with failing/passing regressions and real native, Codex, and Copilot Gateway runs, including credential recovery and same-process worker-policy reloads. Reuse the native auth test fixture instead of reloading the complete runner in every case. Fixes openclaw#131552 Fixes openclaw#131580 Fixes openclaw#131591 Fixes openclaw#131699 Fixes openclaw#131700 Fixes openclaw#131701 Thanks to @tmill313 for the original Codex collector report in openclaw#120077. * test(agents): keep collector proofs on owned boundaries Move real collector-tool and prepared-registry integration proof to core, retain independent plugin SDK handoff regressions, and select the host Copilot integration for plugin-only changes. Run the existing plugin-test core-import guard in changed-file checks so local validation catches the same boundary violation as CI. The replacement regressions fail against their pre-fix owners. All 505 focused tests, the exact import guard, and the changed-file gate pass. Independent review found no actionable P0-P2 findings. Runtime repair files are unchanged. * test(agents): load prepared harness through its public boundary Evaluate the real Copilot entrypoint through the existing public-surface loader and module-loader seam instead of importing plugin implementation into the core typegraph. Remove the synthetic entrypoint and registration global, while retaining real discovery and lazy-store assertions. Include the existing core tsgo graph boundary in changed-file checks and cover its ordinary and live-Docker routing paths. * test(mcp): seed canonical SQLite session history Use the installed candidate's public session APIs instead of creating legacy session files rejected by doctor-only startup. Preserve message IDs, parent ordering, delivery context, and canonical attachment metadata. Add a built-SDK fixture regression using real SQLite reads and startup validation. The full MCP client remains covered by the Docker CI lane. * test(gateway): preserve queued writes across RPC fixtures Stop clearing session writer queues before ordinary RPCs. Config fixtures still synchronize, while canonical writers retain their own cache updates. Prove queued-write ordering through a real connected Gateway against a raw WebSocket control, and dispose the custom test database before file removal. Preserve the underlying cause of the settlement timeout. That CI failure was not reproduced on the exact synthetic merge locally; the independent queue-reset defect is not being claimed as its established cause. * test(agents): keep harness fixture coverage on focused boundaries * test(imap): await committed watcher initialization
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
What Problem This Solves
Swarm collector turns on the Codex harness omitted
structured_outputand still exposed Codex-native Bash/shell tools, even when OpenClaw's allowlist was collector-only. Collectors could not emit schema-valid structured results reliably, and Bash hits polluted confinement expectations.Summary
swarmCollector/swarmOutputSchema) into Codex dynamic tool build so collectors always receivestructured_output, and fail closed if it is still missing.Evidence
node scripts/run-vitest.mjs run extensions/codex/src/app-server/dynamic-tool-build.test.ts extensions/codex/src/app-server/run-attempt-tools.test.ts→ 63/63 passed after rebase onto currentmain.agents_waitreturnedstatus: done, matching sentinel, zero Bash hits for that run (runIdd38fbce2-…).d342d20b45onfix/codex-swarm-structured-output.Test plan