Merge master current-directory support into subagent activations
Integrate the observed master checkpoint 7ab215e23e5d977aae7eb5d4fb91782d39969dbb without rewriting the earlier published checkpoints. Master adds current-directory events, directory-aware consumers, and retained Git worktrees; its old subagent startup paths overlapped the unified activation implementation. Resolve directory selection within managed startup after acquiring parent ownership. Preserve the original Session origin while setting each new local child directory, retain persisted directory state on cold resume, and pass a required absolute cwd to external providers. Keep unified local/external ownership, full completion notices, parked-input host completion, SDK wait/error/shutdown behavior, and ACP cancellation semantics. Retain removal of the old in-process driver and continuation managers. Combine SDK wait with the new directory requests, preserve the new master directory/worktree fixtures, regenerate derived catalogs from the combined sources, and refresh only the four stale prompt/schema sidecars. Preserve every protected historical schema, archived note, catalog-v2 acknowledgement, and recorded predecessor input. Validation: full build; 59 CI static gates; 855 subagent tests with 100% coverage on changed core/external sources; affected consumer suites including 119 repaired-fixture tests; SDK 11 and headless 16 recorded scenarios; two local headless expected cases; six built nested SDK/ACP cases; lint, strict cast inventory, workspace constraints, and whitespace checks. Native Windows worker diagnostics remain additive and require the next CI run to classify the original crash.
This commit is contained in:
commit
a3cb678875
1125 files changed
+31903
-6278
No files matched your search
@@ -1757,7 +1757,10 @@ def smoke_sdk_scheduler_recovery(base_url: str, executable: Path, update_snapsho
|
||||
raise AssertionError(f"scheduler recovery duplicated or lost tool outcomes: {tool_results}")
|
||||
if sum(record.get("type") == "todo/write" for record in records) != 1:
|
||||
raise AssertionError("scheduler recovery executed an unstarted todo update")
|
||||
replacements = [(str(root), "{{cwd}}"), (RECOVERY_SESSION_ID, "{{parent}}")]
|
||||
replacements = [
|
||||
*snapshot_directory_replacements(root, "{{cwd}}"),
|
||||
(RECOVERY_SESSION_ID, "{{parent}}"),
|
||||
]
|
||||
result_value = [{
|
||||
"session_id": result.session_id,
|
||||
"final_response": result.final_response,
|
||||
@@ -2294,8 +2297,8 @@ def build_minimal_snapshot_files(
|
||||
kept verbatim: they carry what the deployment actually shows the model, so a plugin
|
||||
that contributes an unintended system section or user message cannot pass unnoticed.
|
||||
Assistant and tool payloads keep only their call identity because their text differs
|
||||
across the platforms this expected output must replay on. The shipped profile omits
|
||||
dynamic runtime context, so every message it emits is compared.
|
||||
across the platforms this expected output must replay on. Required working-directory
|
||||
context remains visible even when the profile disables optional runtime context.
|
||||
"""
|
||||
snapshot = []
|
||||
for body in requests:
|
||||
@@ -2345,10 +2348,18 @@ def minimal_snapshot_message(message: object, cwd: Path) -> dict[str, object]:
|
||||
raise AssertionError(f"minimal model request has an unexpected message role: {message}")
|
||||
|
||||
|
||||
def snapshot_directory_replacements(directory: Path, token: str) -> list[tuple[str, str]]:
|
||||
"""Pin the allocated fixture path in plain fields and JSON-quoted context text."""
|
||||
path = str(directory)
|
||||
return [(json.dumps(path, ensure_ascii=False)[1:-1], token), (path, token)]
|
||||
|
||||
|
||||
def minimal_snapshot_text(value: object, cwd: Path) -> object:
|
||||
"""Replace the scenario's temporary working directory everywhere it appears."""
|
||||
if isinstance(value, str):
|
||||
return value.replace(str(cwd), "{{cwd}}")
|
||||
for actual, token in snapshot_directory_replacements(cwd, "{{cwd}}"):
|
||||
value = value.replace(actual, token)
|
||||
return value
|
||||
if isinstance(value, list):
|
||||
return [minimal_snapshot_text(item, cwd) for item in value]
|
||||
if isinstance(value, dict):
|
||||
@@ -2363,7 +2374,7 @@ def build_snapshot_files(
|
||||
cwd: Path,
|
||||
) -> dict[str, str]:
|
||||
"""Render the SDK result and three persisted logs into stable expected outputs."""
|
||||
replacements = [(str(cwd), "{{cwd}}"), (SNAPSHOT_SESSION_ID, "{{parent}}")]
|
||||
replacements = snapshot_directory_replacements(cwd, "{{cwd}}") + [(SNAPSHOT_SESSION_ID, "{{parent}}")]
|
||||
replacements.append((snapshot_workflow_run_id(result), "{{workflow-run}}"))
|
||||
for index, child_id in enumerate(child_ids, start=1):
|
||||
replacements.append((child_id, f"{{{{child-{index}}}}}"))
|
||||
@@ -2435,8 +2446,8 @@ def build_restart_snapshot_files(
|
||||
) -> dict[str, str]:
|
||||
"""Render two SDK processes, isolated model histories, and durable logs."""
|
||||
replacements = [
|
||||
(str(sessions), "{{sessions}}"),
|
||||
(str(cwd), "{{cwd}}"),
|
||||
*snapshot_directory_replacements(sessions, "{{sessions}}"),
|
||||
*snapshot_directory_replacements(cwd, "{{cwd}}"),
|
||||
(RESTART_FIRST_SESSION_ID, "{{session-1}}"),
|
||||
(RESTART_SECOND_SESSION_ID, "{{session-2}}"),
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user