feat(turn): bind the default Turn host to the operator credential - #4409
Closed
huangruiteng wants to merge 3 commits into
Closed
huangruiteng wants to merge 3 commits into
huangruiteng wants to merge 3 commits into
Conversation
huangruiteng
force-pushed
the
codex/default-turn-host-binding-20260915
branch
from
September 15, 2026 04:34
dd78fed to
ca4f3cd
Compare
huangruiteng
changed the base branch from
main
to
codex/dsh-latest-sdk-20260915
September 15, 2026 04:35
The `deepseek-harness` extra now pins `deepseek-harness-sdk==0.1.5rc1` and its bundled `deepseek-harness-runtime-bin==0.1.5rc1`, the newest release channel published for dsh (PyPI for the wheels, `latest` on npm for `@deepseek-ai/dsh`). The Python client surface is unchanged from the previously pinned `0.1.2a3`; the bump moves the bundled dsh runtime behind the managed host. Validation (hermetic, local mock LLM, no provider call): - `examples/loopx-turn-dsh-real-e2e-smoke.py --host generic-cli` and `--host dsh` both pass against 0.1.2a3 (control) and 0.1.5rc1. - `tests/test_dsh_goal_mode.py` (55 passed), `examples/dsh-turn-host-adapter-smoke.py` (11 checks), `examples/loopx-turn-dsh-e2e-smoke.py`, `examples/loopx-turn-dsh-builtin-host-e2e-smoke.py` all pass. Signed-off-by: Codex Product Agent <codex@loopx.local> Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
`loopx turn run-once` defaulted to `generic-cli` and `loopx turn plan` hard-coded `codex-cli`, so a machine with an operator-supplied model credential still needed an explicit `--host dsh` to keep governed Turns off an individual CLI subscription. Default host resolution now follows one typed rule in `control_plane/turn_driver/host_binding.py`: a non-empty `DEEPSEEK_API_KEY` selects the `dsh` host, and an unconfigured credential keeps `codex-cli`. `DEEPSEEK_BASE_URL` chooses the endpoint but does not switch hosts, an explicit `--host` still wins, and `turn plan` now accepts the `dsh` host it can already route. Tests that encoded the former `generic-cli` default pass it explicitly now, and `tests/test_turn_default_host_binding.py` covers the resolution matrix plus both CLI defaults. Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Record the shipped default-host rule on the connector surface: a configured `DEEPSEEK_API_KEY` selects `dsh`, no configured credential keeps `codex-cli`, `DEEPSEEK_BASE_URL` does not switch hosts on its own, an explicit `--host` wins, and the resolved value is what `turn plan` reports back. Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
force-pushed
the
codex/dsh-latest-sdk-20260915
branch
from
September 15, 2026 05:13
09dab3a to
5712e20
Compare
huangruiteng
force-pushed
the
codex/default-turn-host-binding-20260915
branch
from
September 15, 2026 05:13
ca4f3cd to
bcade15
Compare
huangruiteng
force-pushed
the
codex/dsh-latest-sdk-20260915
branch
from
September 15, 2026 06:51
5712e20 to
bd731c1
Compare
Collaborator
Author
|
Superseded by #4443 ( The value here is kept: the shipped managed default, the explicit #4443 is main-based rather than stacked, so it needs one review and carries no layer-refresh cost. Closing this to compress the delivery chain. |
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.
Summary
loopx turn run-oncedefaulted togeneric-cliandloopx turn planhard-codedcodex-cli, so an operator who had configured their own model credential stillhad to pass
--host dshexplicitly to keep governed Turns off an individual CLIsubscription.
Default host resolution is now one typed rule in
loopx/control_plane/turn_driver/host_binding.py:--hostDEEPSEEK_API_KEYset to a non-empty valuedshcodex-cliDEEPSEEK_BASE_URLselects the endpoint the credential is used against but doesnot switch hosts on its own; whitespace-only values count as unconfigured; an
explicit
--hostalways wins, and the resolved value is whatloopx turn planreports back.
turn planalso accepts thedshhost it can already route.Default behavior change
loopx turn run-once:generic-cli-> credential-resolved (dshwith aconfigured
DEEPSEEK_API_KEY, otherwisecodex-cli).loopx turn plan:codex-cli-> same credential-resolved default;dshaddedto its explicit
--hostchoices (claude-codeplanning choice unchanged).Tests and one smoke that encoded the former
generic-clidefault now pass--host generic-cliexplicitly, so they keep testing the host they named ratherthan the ambient default.
Validation
tests/test_turn_default_host_binding.pycovers the resolution matrix(configured, empty, whitespace-only, endpoint-without-credential), both CLI
defaults with and without the credential, and explicit
--hostprecedence.No live provider call is made by this change or its tests. Public/private scan of
the touched paths is clean (no local paths, credentials, or private context).
Refactor pass
The resolution rule lives in one typed module with a single call site per
command default, so the next host surface (the manager executor and manager
model defaults) can consume the same rule instead of re-deriving it.
Stack
This stack now carries the dsh release pin: #4420 (
deepseek-harness-sdk==0.1.5rc1, upstream released channel) -> #4409 -> #4416 -> #4417 -> #4419. Each branch was rebased on the pin; the managed dsh default therefore runs on the current released runtime rather than the previous0.1.2a3pin.