Skip to content

test(codex): pin agents.enabled false after sessions_spawn became the only subagent surface - #207595

Merged
obviyus merged 1 commit into
mainfrom
fix/codex-agents-enabled-test
Nov 28, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/codex-agents-enabled-test

Conversation

@obviyus

@obviyus obviyus commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

src/agents/harness/codex-subagent-tool-policy.test.ts fails on main: Codex subagent native tool policy > preserves native tools for OpenClaw admin/status-only denial gets an AssertionError (agents.enabled is false, the test requires undefined). It fails in every scheduled run since #207303, for example job checks-node-compact-large-31 in run 46154601106 (https://github.com/openclaw/openclaw/actions/runs/46154601106).

The test is stale. #207303 intentionally made every Codex thread set agents.enabled, features.multi_agent and features.multi_agent_v2 to false (extensions/codex/src/app-server/thread-requests.ts:328, spread of CODEX_DELEGATION_DISABLED_THREAD_CONFIG in buildCodexRuntimeThreadConfig). Before it, the value was set only when a deny hit native delegation, so an admin/status-only deny left it unset.

Bisect: the parent of #207303 passes this file 17/17; #207303 fails exactly this case.

Fix

  • Line 153: assert agents.enabled is false, which pins fix(codex): use sessions_spawn as the only subagent surface #207303's invariant instead of removing the check.
  • The comment in preserves the effective policy for $name said session denies are enforced by disabling native delegation. Delegation is now off on every thread; the comment says so.

Test-only. No production change.

User Impact

None at runtime. Main's checks-node-compact-large-31 goes green for this file.

Evidence

  • Red on main 3e55ac1: codex-subagent-tool-policy.test.ts fails 1 case (the one above).
  • Green on this head: that file (17/17) plus the tests of thread-requests.ts consumers (thread-delegation, thread-lifecycle, thread-policy, thread-requests.managed-requirements, turn-params, run-attempt-tools and 9 more): 16 files, 337 tests pass.
  • Format and oxlint clean on the changed file. Diff: +5 / -4, one test file.

… only subagent surface

- The admin/status-only denial case required agents.enabled to be unset; #207303 disables native delegation on every Codex thread, so require false.
- Update the effective-policy comment to match.
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Nov 28, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 28, 2026
@obviyus
obviyus merged commit d5db03d into main Nov 28, 2026
108 checks passed
@obviyus
obviyus deleted the fix/codex-agents-enabled-test branch November 28, 2026 16:22
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
… only subagent surface (openclaw#207595)

## What Problem This Solves

`src/agents/harness/codex-subagent-tool-policy.test.ts` fails on main: `Codex subagent native tool policy > preserves native tools for OpenClaw admin/status-only denial` gets an `AssertionError` (`agents.enabled` is `false`, the test requires `undefined`). It fails in every scheduled run since openclaw#207303, for example job `checks-node-compact-large-31` in run 46154601106 (https://github.com/openclaw/openclaw/actions/runs/46154601106).

The test is stale. openclaw#207303 intentionally made every Codex thread set `agents.enabled`, `features.multi_agent` and `features.multi_agent_v2` to false (`extensions/codex/src/app-server/thread-requests.ts:328`, spread of `CODEX_DELEGATION_DISABLED_THREAD_CONFIG` in `buildCodexRuntimeThreadConfig`). Before it, the value was set only when a deny hit native delegation, so an admin/status-only deny left it unset.

Bisect: the parent of openclaw#207303 passes this file 17/17; openclaw#207303 fails exactly this case.

## Fix

- Line 153: assert `agents.enabled` is `false`, which pins openclaw#207303's invariant instead of removing the check.
- The comment in `preserves the effective policy for $name` said session denies are enforced by disabling native delegation. Delegation is now off on every thread; the comment says so.

Test-only. No production change.

## User Impact

None at runtime. Main's `checks-node-compact-large-31` goes green for this file.

## Evidence
- Red on main c8c5eec: `codex-subagent-tool-policy.test.ts` fails 1 case (the one above).
- Green on this head: that file (17/17) plus the tests of `thread-requests.ts` consumers (thread-delegation, thread-lifecycle, thread-policy, thread-requests.managed-requirements, turn-params, run-attempt-tools and 9 more): 16 files, 337 tests pass.
- Format and oxlint clean on the changed file. Diff: +5 / -4, one test file.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 29, 2026
…e database (#207535)

Reopen the captured Doctor writer after successful state schema preparation. Later auth repairs can reuse it even after the config worker opens its own connection.

(cherry picked from commit 3e55ac1)

Companion disposition: #207585 is a later main update-process refactor, not needed by the retained Doctor flow; #207595 is a Codex fixture change.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant