Preserve image replay compatibility across CLI image limits - #2670
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The focused changes appear coherent, but the required CI run still has three unresolved Rust failures.
Review tier: Balanced
Findings: None
What changed in this PR
Restores strict replay compatibility for both legacy one-image and newer multi-image CLI histories without changing SDK runtime behavior.
Changes:
- Restores authentic image-bearing snapshot conversations while retaining pinned-CLI alternatives.
- Adds HTTP replay coverage for accepted histories, final responses, and rejected mismatches.
| File | Description |
|---|---|
test/snapshots/session_config/vision_disabled_then_enabled_via_setmodel.yaml |
Adds the restored multi-image history. |
test/snapshots/session_config/should_accept_blob_attachments.yaml |
Adds the restored image-bearing attachment history. |
test/harness/replayingCapiProxy.test.ts |
Tests strict replay acceptance and rejection behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for #2670 · copilot · sonnet50 · 39 AIC · ⌖ 13.3 AIC · ⊞ 8.3K
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Restore authentic image-bearing recordings alongside exact one-image histories needed by the SDK-pinned CLI. Add strict HTTP replay coverage for both histories, completion, and rejected unrecorded image content. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep both legal completion-notification histories without changing hooks or matching. Require the final subagent answer followed by idle, and add scoped elapsed diagnostics for the still-unclassified resume timeout. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Discover independently owned CLI processes in pending test frames and retain failure-only diagnostics from both Python CI matrices. Preserve existing failures and test commands while collecting the native evidence needed to diagnose stalled session.resume responses. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Write and close a sibling file before publishing the readiness path. This prevents the lifecycle test from observing an empty or partial PID before terminating the host. Keep the process-liveness assertions and deadlines unchanged, and cover complete publication and failed writes with deterministic filesystem regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
b70e444 to
bdd7242
Compare
SDK Consistency ReviewI reviewed the changes in this PR against the six SDK implementations (Node.js/TypeScript, Python, Go, .NET, Java, Rust). Scope of changes: All modified/added files are test infrastructure and CI/tooling only — no SDK client/public API source files were touched:
None of these changes add or modify a public SDK feature/API surface ( Conclusion: No cross-SDK API consistency issues found. This PR is out of scope for feature-parity review since it doesn't change any SDK client behavior.
|
Run each in-process E2E test in a fresh worker and isolate multi-context subtests before starting native hosts. Keep the public in-process Env rejection unchanged while preventing native threads from racing process environment restoration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
bdd7242 to
0b58a09
Compare
Purpose
Companion to the intentional temporary 50-image policy change in github/copilot-agent-runtime#20783, exposed by CAPI CI for github/copilot-agent-runtime#18323. This PR preserves strict replay compatibility across supported CLI image limits and repairs independent SDK test defects exposed while validating the change. It does not change runtime image policy, weaken replay matching, extend test deadlines, or claim to fix the unresolved native Python resume hang.
The branch is rebased onto current
main(583f8f1a, CLI 1.0.85) and contains five focused commits:Image recording compatibility
SDK #2634 replaced two authentic
[image]histories with one-image-limit warnings. Cap-50 runtimes send the image again; that is the first mismatch, while later retries and proxy 500s are consequences. Currentmainnow contains the cap-50 recordings. This PR retains those histories and adds the exact cap-one alternatives required by older supported CLI 1.0.84-8.The affected files are:
test/snapshots/session_config/should_accept_blob_attachments.yamltest/snapshots/session_config/vision_disabled_then_enabled_via_setmodel.yamltest/harness/replayingCapiProxy.test.tsThe normalizer remains unchanged. HTTP regressions require both exact histories to reach the final assistant response with
finish_reason: stop; missing images and unrecorded image-limit variants still fail. Both vision-disabled and vision-enabled assertions remain intact.session/should_accept_blob_attachments.yamlis unchanged because it has no follow-upviewexchange.Evidence used the same cap-50 Windows runtime before and after: runtime run 34949630134, job
104318144383, checkout929c696286c2eaecf66ee8946a2377cb47a15fed, including policy merge9a28569ea31113d48975999a4b0beb66d8af2252;app.jsSHA-2566f1ead6e3458b86204e23d2a170086688737d89e14bf1d6a0110f83cb05be048.Strict subagent replay
The initial PR CI exposed a legal ordering where the child-completion notification arrives before the parent's waiting response.
8331dde7adds one finite exact alternative using the observed notification and existing assistant/tool/final-answer content. It does not add a hook barrier, production ordering change, permissive matcher, or normalization rule.The Rust hook test still requires the final subagent answer followed by
session.idle, preserving hook, session-ID, and request-metadata assertions. Seven HTTP regressions cover both legal orders with streaming on and off plus malformed-history rejection. The shared harness suite passes 43/43 on the rebased head.Python timeout evidence
54f91678preserves failure-only.pytest-diagnosticsartifacts for both Python CI matrices and discovers independently owned CLI processes from pending test frames. macOS sampling remains bounded. No arbitrary locals, protocol payloads, credentials, results, production lifecycle behavior, assertions, or deadlines are changed.The latest retained macOS evidence showed
session.resumepending for 299.997 seconds while SDK/FFI locks were free and two nativecopilot-cabithreads remained blocked in pthread mutex acquisition. The exact released image is stripped and the release workflow retained no matching symbols, so native attribution remains blocked on matching symbols or a symbolized reproduction. No speculative SDK workaround is included.Rust fixture publication
b5c9558ffixes the Windows host-crash fixture readiness race by writing and closing a sibling PID file before atomically renaming it to the observed path. The production SDK is unchanged. Deterministic filesystem regressions failed before and passed after; the complete native lifecycle group, nightly formatting, strict Clippy, and fullcargo test --all-featurespassed with 895 tests and 45 existing ignores.Go in-process E2E isolation
The earlier Go-only per-host
Envcapability and its four follow-up commits were removed from history. Go is again consistent with Node.js, Python, .NET, Java, and Rust at the public API boundary:ClientOptions.EnvwithInProcessConnectionis rejected, and there are no changes togo/client.go,go/types.go, orgo/README.md.0b58a09afixes the harness defect instead:-test.gocoverdircounters are preserved.BaseDirectoryand token options while keeping the process-wide proxy stable.Validation on Windows with race detection:
Envrejection: passed.AutoTier,ClientOptions,RPCMCPConfig,RPCServer,RpcServerMisc,RpcServerPlugins,PreMCPToolCallHook): passed.ClientAPI,RPCSessionState,StreamingFidelity): passed.PreMCPToolCallHookalso passed over the default stdio transport.extensionSdkPathbecause the local standalone runtime lacks the extension SDK assets; they occur before replay and are not caused by this change.internal/ffihost/ffihost.go:334:31unsafe-pointer warning; focused package tests and all modified-path checks pass.Current state
Current head:
0b58a09a4f68e4192100c2d7e5276e4aea1ea23a. The prior head's Ubuntu in-process Go failure was aSIGCHLD/SA_ONSTACKcrash while one worker repeatedly launched MCP child processes; the nested-worker change addresses that path. The prior .NET macOS CAPI failure occurred before test execution because GitHub returned HTTP 500 for the pinned CLI release download, so no .NET code change was warranted.The complete current-head matrix is green, including all Go default/in-process cells on Ubuntu, macOS, Windows, and Alpine ARM64; all .NET CAPI cells; all Python native/stdio cells; all Rust default/in-process cells; and every required aggregate check. No jobs were manually rerun and no coverage was weakened. The PR remains open and unmerged.
Generated by Copilot