Repository navigation
refactor(agents): consolidate transcript-tail model selection - #157382
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 maintainer review before merge. Reviewed September 24, 2026, 12:01 PM ET / 16:01 UTC. ClawSweeper reviewWhat this changesThe branch replaces two transcript-routing call paths in embedded agent model selection with one and adds tests for session routing and operator authority. Merge readiness✅ Ready for maintainer review Keep open: current main still contains the duplicated path, and the focused PR remains useful. Source review found no concrete regression. Priority: P3 Review scores
Verification
How this fits togetherAgent command model selection prepares the model and session context for an embedded run. A transcript resolver returns the routing token and session entry passed to the run attempt. flowchart LR
A[Agent command and session] --> B[Model selection]
P[Operator policy] --> B
B --> C{Keyed store usable?}
C --> D[Transcript resolver]
D --> E[Routing token and session entry]
E --> F[Embedded run attempt]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -9, Tests +109. Total +100 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the transcript resolver as the single routing owner, with focused coverage for keyed-store isolation, explicit-entry precedence, and authority rechecks. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor rather than a reported failure; the duplicated calls are visible in current-main source. Is this the best way to solve the issue? Yes: one call to the existing resolver is a narrow simplification under its current routing-token contract, and the keyed-store and operator checks remain in place. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 057a032fe19e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '9a1a6f7db9783d0b8abaf918bfe12978ea745b57': (26 commits) fix(maintainer): restore cold PR worktree provisioning (#157394) feat(ios): establish native Cloudflare Access sign-in sessions (#146996) fix: restore the Gateway after interrupted Doctor maintenance (#156854) refactor(line): retire the Express webhook adapter (#157369) refactor(cron): consolidate unavailable delivery targets (#157393) ci: apply Go memory defaults to architecture checks fix(cli): preserve the first PowerShell completion test failure (#157267) refactor(agents): consolidate transcript-tail model selection (#157382) fix(release): honor frozen validation contracts (#157034) fix(perf): use settled Kova terminal CPU accounting (#157029) chore(windows): verify packaged repair worker lifecycle (#157047) refactor(logging): share memory pressure threshold selection (#157164) fix(release): verify bundled fs-safe native bindings (#157027) perf(skills): skip warm prompt search when minimum cannot fit (#157343) fix(ui): avoid retaining detached tooltip anchors (#157226) perf(ci): reuse compiler state and shorten guard and UI tests (#157265) perf(ui): preserve model caches on unrelated metadata updates (#157254) chore: remove the tracked PR-body artifact and ignore .artifacts (#157296) refactor: consolidate duplicate MCP lifecycle tests (#157360) test(qa): consolidate CLI runtime fixtures (#118496) ...
…aw#157382) Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Command model selection duplicated transcript-tail resolution across the stored-session and fallback paths, making the routing and authority rules harder to maintain.
User Impact
No user-visible behavior change. Session routing, suppressed store access, explicit-entry precedence and the operator-authority check remain unchanged. No configuration, storage schema or public API changes.
Why This Change Was Made
Use one resolver call with the existing keyed-store decision. Preserve empty-string keys, the selected attempt entry and the authority recheck after the lazy loader. Production code shrinks by 9 lines; tests add 109 lines covering 14 routing and authority cases.
Evidence
check:runtime-sidecar-loaderson a fresh pinned remote install. Source guards passed and the remote lease stopped successfully.rust-v0.155.1contracts incodex-rs/app-server-protocol/src/protocol/v2/thread.rs(62–159, 335–410) andcodex-rs/app-server/src/request_processors/thread_processor.rs(554–576, 3641–4219), alongside OpenClaw's resolver, command caller and Codex thread-request bridge. Routing keys remain distinct from native thread IDs and rollout paths.Remaining gate: exact-head hosted CI must cover the outstanding core type graphs and remaining canonical checks before landing. No live-session or runtime-speedup claim. Build/module and published-surface boundaries are unchanged.