Repository navigation
test: load placement admission after CLI execution mocks - #197050
Merged
Merged
Conversation
Since #196984, Gateway session utilities import the run-entry CLI runtime selector. The suite's static placement-admission import now evaluates that graph before the shared harness registers its model-selection mock, so the selector keeps the real isCliProvider and routes codex-cli turns to the embedded runner. Import placement admission after harness setup. Co-authored-by: obviyus <[email protected]>
Contributor
|
🦞👀 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. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 12, 2026
…7050) Since openclaw#196984, Gateway session utilities import the run-entry CLI runtime selector. The suite's static placement-admission import now evaluates that graph before the shared harness registers its model-selection mock, so the selector keeps the real isCliProvider and routes codex-cli turns to the embedded runner. Import placement admission after harness setup. Co-authored-by: obviyus <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes: 4 tests in
src/auto-reply/reply/agent-runner-execution-cli-sessions.test.tsfail on main (thecodex-clicases, e.g. "passes prepared CLI user turns to the runtime persistence boundary"). Main CI only runs tests affected by each change, so this went red unnoticed and now blocksci-gateon unrelated PRs (seen on #196480).User Impact
User impact: none. Test-only; no production change.
Why This Change Was Made
Bisected between
81ab38d(passes) and main (fails): first bad commitb8980ca(#196984). That PR madesrc/gateway/session-utils-store.tsimportembedded-agent-runner/run-entry-runtime.ts. This test statically importsinstallSessionPlacementAdmissionProvider, whose graph (session-placement-admission→session-utils→session-utils-store→run-entry-runtime) now evaluates before the harness registers itsmodel-selectionmock. The CLI runtime selector therefore binds the realisCliProvider, which only recognizescodex-cliwhen its plugin backend is registered. The turn falls through to the embedded runner, whose mock returnsundefined, and the swallowedTypeError: undefined is not an object (evaluating 'result.meta')becomes the generic error reply.The test now loads
installSessionPlacementAdmissionProviderwith a dynamic import aftersetupAgentRunnerExecutionTestState(), the same pattern other suites insrc/auto-reply/replyuse. #196984's authority checks are untouched.Evidence
agent-runner-execution-cli-admission.test.ts: 27/27 on current main (clean env).agent-runner-execution*,openclaw-delegate-tool*,gateway-caller-context,runtime-snapshot,zod-schema.agentsandsystem-agent-approval*.check:test-mock-exportspass.For the #196984 author: the new
session-utils-store.ts→run-entry-runtime.tsedge makes any suite that statically imports the session-utils graph before its mocks bind real CLI detection;agent-runner-execution-cli-admission.test.tsdoes so today but only usesclaude-cli. A lazy import ofresolveRunEntryCliRuntimeinresolveAgentDefaultPermissionLabelwould remove that hazard; left as is here.