Repository navigation
feat(agents): allow thinking overrides on visible sessions - #135296
sunlit-deng wants to merge 2 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR allows explicit thinking levels when spawning visible child sessions while preserving Gateway defaults when thinking is omitted. Example: An agent calls sessions_spawn with visible=true and thinking="HIGH".
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep open: current main still lacks this capability, and maintainer discussion explicitly preserves its separate review; product approval remains unresolved. Priority: P3 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe sessions_spawn tool passes visible-child requests through the visible adapter to Gateway session creation, which validates and persists preferences before starting the child agent. flowchart LR
A[Agent tool call] --> B[sessions_spawn]
B --> C[Visible spawn adapter]
C --> D[Thinking normalization]
D --> E[Gateway sessions.create]
E --> F[Persisted session]
F --> G[Child agent turn]
Technical reviewBest possible solution: If approved, forward normalized explicit thinking through the existing session-creation owner while preserving omitted-value defaults. Do we have a high-confidence way to reproduce the issue? Current-main source explicitly rejects visible thinking overrides, consistent with the documented restriction; no runtime reproduction was performed. Is this the best way to solve the issue? Creation-time forwarding uses the correct persistence boundary and avoids changing thinking after the first turn starts, subject to approval of the explicit-only behavior. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6c533f67f6ee. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +32, Tests +1182, Docs 0, Other -1. Total +1213 across 21 files. Added test files: 3. 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. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (50 earlier review cycles; latest 8 shown)
Reviewed October 18, 2026, 6:33 AM ET / 10:33 UTC (Revision 51). |
8325263 to
16842f9
Compare
16842f9 to
f7a7cea
Compare
b2ddc5c to
fe5706f
Compare
fe5706f to
31b33df
Compare
31b33df to
1dc77a6
Compare
1dc77a6 to
267a87f
Compare
267a87f to
87f1e88
Compare
|
Related, but not superseded by merged #146343. That change adjusts authorization for patches to an existing session; it does not add explicit thinking support to sessions_spawn(visible=true) or forward that input during child creation. Explicit-input validation and omitted-value/default-preservation behavior are separate creation-time concerns. This PR requires its own review and merge decision. |
|
Thanks @sunlit-deng for the work and validation. Closing under the current scope decision: users can already change a visible session's thinking level with The explicit override before a visible child's first turn remains a distinct feature, as the earlier comment notes; #146343 did not implement that spawn flag. We are choosing the existing session-settings surface for this request rather than extending creation-time inputs. The PR's explicit-only validation and omitted-default preservation are useful requirements if that separate feature is revisited. Contributor code was read, not run. |
Rebase and review update (2026-10-26)
Rebased
sunlit/fix/issue-134530ontoopenclaw/mainatd777ae1239625a8cadb3da17e7a057d0c4de71fa. The first rebase onto4a97c0a9c637e7ef92cdbcf8183c48293f602e04had conflicts in four source/test files and three prompt snapshots; those were resolved while preserving current main behavior and regenerating the snapshots. After main advanced, a rebase onto28e277436e7055d3e5de159299663464ea0a2c6ccompleted without conflicts. The subsequent rebase ontod777ae1239625a8cadb3da17e7a057d0c4de71fahad conflicts in two prompt snapshots; they were resolved from the latest main state and regenerated against the final tool descriptions.Conflicted files:
src/agents/tool-description-presets.test.ts,src/agents/tools/sessions-spawn-outcome.test.ts,src/agents/tools/sessions-spawn-tool.input.test-support.ts,src/agents/tools/sessions-spawn-visible.ts,test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/discord-group-codex-message-tool.md.diff,test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/telegram-direct-codex-message-tool.md, andtest/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/telegram-heartbeat-codex-tool.md.diff.The later rebase onto
d777ae1239625a8cadb3da17e7a057d0c4de71faconflicted again intest/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/discord-group-codex-message-tool.md.diffandtest/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/telegram-direct-codex-message-tool.md; both were regenerated and validated.What Problem This Solves
Adds explicit thinking-level control to visible
sessions_spawnsessions while leaving omitted values under the Gateway's child-session default.Fixes #134530
Why This Change Was Made
Visible spawning forwards only an explicitly supplied thinking value to
sessions.create. The shared thinking resolver normalizes supported levels for the resolved model and corrected retry calls. Omitted values remain controlled by the Gateway.User Impact
Visible child sessions can request a supported thinking level. Calls that omit it keep the Gateway-selected default.
Maintainer Decision
The requested explicit override for visible
sessions_spawncalls is approved. The tool validates and forwards a supplied value tosessions.create, and preserves it when a visible call is corrected and retried. Ifthinkingis omitted, the tool omits the field so the Gateway continues to select the default.Evidence
d777ae1239625a8cadb3da17e7a057d0c4de71fa.0f516fbdab32c97978473de00ea1b62ae96bfec3.test/proofs/proof-pr135296-visible-thinking-cli.mts.openclaw agentCLI, uses a deterministic OpenAI Responses endpoint bound to127.0.0.1, and reads the resulting session through productiongateway call sessions.list. No external provider or agent-command/discovery mocks are used.Run each scenario from the repository root:
Captured fields from the four exact-HEAD proof JSON results (
passed: truein each):The production CLI proof was run on the PR head. On the unmodified pinned base, the focused test
reports every unsupported visible parameter in one errorpassed and its expected error confirms visiblethinkingwas unsupported there.pnpm prompt:snapshots:check: current, 6 snapshot files.AI-assisted: built with Codex