Merge commit 'ead58a4a476200de2a2f2549ef6a02e73752b618' into codex/dsh-sdk-dynamic-subagent-routing

# Conflicts:
#	.agents/notes/implemented/feature/2026-07-27-typescript-sdk-and-sdk-subagent-backend.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-27-typescript-sdk-and-sdk-subagent-backend.md
#	.agents/notes/implemented/feature/2026-07-27-typescript-sdk-and-sdk-subagent-backend.zh.md
#	examples/python-sdk-agent/tests/sdk.snapshot.ts
#	packages/sdk/client/README.i18n.yaml
#	packages/sdk/client/README.md
#	packages/sdk/client/README.zh.md
#	packages/sdk/client/src/types.ts
#	packages/sdk/protocol/README.i18n.yaml
#	packages/sdk/protocol/README.md
#	packages/sdk/protocol/README.zh.md
#	packages/sdk/server/src/server.ts
#	packages/subagent/subagent-dsh-sdk/tests/fixtures/loader/snapshot.cordis.yml
#	packages/subagent/subagent-dsh-sdk/tests/fixtures/loader/snapshot.replay.cordis.yml
This commit is contained in:
pku-xht
2026-08-25 18:01:08 +08:00
2168 changed files with 34789 additions and 13242 deletions
+18 -23
View File
@@ -473,9 +473,7 @@ for line in sys.stdin:
""".strip()
)
with HarnessClient(
HarnessConfig(_launch_args=(sys.executable, str(script)))
) as client:
with HarnessClient(_launch_args=(sys.executable, str(script))) as client:
init = client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
assert init.serverInfo.name == "fake-dsh"
@@ -613,7 +611,7 @@ for line in sys.stdin:
def broken_filter(_notification: object) -> bool:
raise RuntimeError("bad notification filter")
with HarnessClient(HarnessConfig(_launch_args=(sys.executable, str(script)))) as client:
with HarnessClient(_launch_args=(sys.executable, str(script))) as client:
client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
with (
client.subscribe_notifications(broken_filter) as broken,
@@ -650,7 +648,7 @@ for line in sys.stdin:
""".strip()
)
with HarnessClient(HarnessConfig(_launch_args=(sys.executable, str(script)))) as client:
with HarnessClient(_launch_args=(sys.executable, str(script))) as client:
client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
with pytest.raises(ValueError):
client.session_prompt("main", [{"type": "text", "text": "fix it"}])
@@ -677,9 +675,7 @@ for line in sys.stdin:
""".strip()
)
with HarnessClient(
HarnessConfig(_launch_args=(sys.executable, str(script)))
) as client:
with HarnessClient(_launch_args=(sys.executable, str(script))) as client:
client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
request = client.next_request()
@@ -711,9 +707,7 @@ for line in sys.stdin:
""".strip()
)
with HarnessClient(
HarnessConfig(_launch_args=(sys.executable, str(script)))
) as client:
with HarnessClient(_launch_args=(sys.executable, str(script))) as client:
init = client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
assert init.serverInfo.name == "fake-dsh"
@@ -732,10 +726,10 @@ time.sleep(60)
with HarnessClient(
HarnessConfig(
_launch_args=(sys.executable, str(script)),
profile="web",
initialize_timeout_seconds=0.1,
)
),
_launch_args=(sys.executable, str(script)),
) as client:
start = time.monotonic()
try:
@@ -770,9 +764,9 @@ for line in sys.stdin:
client = HarnessClient(
HarnessConfig(
_launch_args=(sys.executable, str(script)),
shutdown_timeout_seconds=0.1,
)
),
_launch_args=(sys.executable, str(script)),
)
client.start()
proc = client._proc
@@ -810,10 +804,10 @@ Path(os.environ["QUIESCED_MARKER"]).write_text("quiesced")
client = HarnessClient(
HarnessConfig(
_launch_args=(sys.executable, str(script)),
env={"QUIESCED_MARKER": str(marker)},
shutdown_timeout_seconds=1,
)
),
_launch_args=(sys.executable, str(script)),
)
client.start()
client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
@@ -840,7 +834,7 @@ for line in sys.stdin:
""".strip()
)
client = HarnessClient(HarnessConfig(_launch_args=(sys.executable, str(script))))
client = HarnessClient(_launch_args=(sys.executable, str(script)))
client.start()
proc = client._proc
assert proc is not None
@@ -882,6 +876,7 @@ def test_public_signatures_omit_unsupported_wire_parameters() -> None:
for removed in ("cordis", "session_root", "runtime_bin", "bridge_bin", "launch_args_override"):
assert removed not in DeepSeekHarnessConfig.__dataclass_fields__
assert removed not in HarnessConfig.__dataclass_fields__
assert "_launch_args" not in HarnessConfig.__dataclass_fields__
assert "session_root" not in RunResult.__dataclass_fields__
@@ -904,7 +899,7 @@ for line in sys.stdin:
""".strip()
)
client = HarnessClient(HarnessConfig(_launch_args=(sys.executable, str(script))))
client = HarnessClient(_launch_args=(sys.executable, str(script)))
client.start()
client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
client.close()
@@ -924,9 +919,9 @@ sys.exit(42)
with HarnessClient(
HarnessConfig(
_launch_args=(sys.executable, str(script)),
request_timeout_seconds=2,
)
),
_launch_args=(sys.executable, str(script)),
) as client:
with pytest.raises(Exception, match="fatal bridge exploded"):
client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
@@ -956,9 +951,9 @@ with open(os.environ["SEEN"], "w") as seen:
with HarnessClient(
HarnessConfig(
_launch_args=(sys.executable, str(script)),
env={"SEEN": str(output)},
)
),
_launch_args=(sys.executable, str(script)),
) as client:
client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
threads = [