Skip to content

feat(rust): add resume skill reload opt-out - #2828

Open
Chuxel wants to merge 1 commit into
mainfrom
chuxel-resume-optional-skills-reload-ownership
Open

Chuxel wants to merge 1 commit into
mainfrom
chuxel-resume-optional-skills-reload-ownership

Conversation

@Chuxel

@Chuxel Chuxel commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #2827.

Add the Rust-local ResumeSessionConfig::with_reload_skills(bool) option. Unset/true retains the existing awaited, best-effort automatic skill reload. Explicit false omits that SDK-issued request for callers that own required skill reconciliation.

The Rust SDK currently waits for session.skills.reload after a successful session.resume reply. Returned reload errors are tolerated, but an unanswered request can keep resume pending. Callers that already own reconciliation cannot currently prevent this additional operation.

The option controls issuance only. It does not disable skills, imply catalog or disabled-preference freshness, cancel an already-issued request, or gate pending work or work running on another connection. No timeout, detached refresh, or retry is introduced.

Compatibility

  • Existing callers retain the same behavior by default; ordinary and prepared resumes share the configured path.
  • Resume validation, MCP-auth interest registration, options setup, event routing, callback ownership, and cleanup are unchanged.
  • The option is not serialized to runtime or AHP host configuration. Explicit session.rpc().skills().reload() remains available.
  • No generated API, runtime pin, dependency, or other SDK language changes.

Synthetic regression coverage

Framed in-memory transport controls cover ordinary/prepared omission, startup events and hooks, mandatory readiness, default/true reload settlement and returned errors, explicit caller reload, provider callbacks, failure/cancellation cleanup, and terminal owner-connection loss. Configuration tests cover cloning, Debug output, preserved skill configuration, and unchanged wire/AHP settings.

Verification

Commands ran from the Rust crate directory without runtime acquisition.

Semantic red: with only the automatic-reload gate temporarily removed, the following compiled and failed both ordinary/prepared opt-out controls on actual session.skills.reload instead of expected session.options.update. The gate was restored immediately.

cargo test --no-default-features --features test-support --test prepared_session_test resume_without_automatic_skill_reload

Passing fixed controls:

cargo test --no-default-features --features test-support --test prepared_session_test --test skill_provider_test
cargo test --no-default-features --features test-support --test session_test startup_callbacks_
cargo test --no-default-features --features test-support --test session_test resume
cargo test --no-default-features --features test-support --lib reload
cargo clippy --no-default-features --features test-support --test prepared_session_test --test skill_provider_test --test session_test -- -D warnings
cargo +nightly-2026-04-14 fmt --all -- --config-path .rustfmt.nightly.toml --check
git diff --check
git show --check --oneline HEAD

Results: 39 prepared-session and 15 provider tests; 6 startup-callback controls; 15 resume-filter tests (one repeats a callback control); and 2 local configuration/wire/AHP unit controls. The no-runtime unit build emitted two existing dead-code warnings. Focused Clippy and pinned formatting passed.

Documentation limitation: strict rustdoc failed on the pre-existing, unchanged HEAD link SessionFsSetProviderConventions at src/session_fs.rs:135. It did not pass.

$env:RUSTDOCFLAGS = '-D rustdoc::broken_intra_doc_links'
cargo doc --no-deps --no-default-features --features test-support

The warning-capped alternative generated documentation with only that warning and no new API-link warnings; unrelated source is unchanged.

$env:RUSTDOCFLAGS = '--cap-lints warn'
cargo doc --no-deps --no-default-features --features test-support

Allow callers that own skill reconciliation to omit the SDK's automatic post-resume reload. Preserve awaited best-effort behavior by default and leave mandatory resume readiness and wire settings unchanged. Cover request omission, retained default behavior, callbacks, and cleanup with framed transport controls.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Chuxel
Chuxel requested a review from a team as a code owner October 9, 2026 06:37
Copilot AI balanced review requested due to automatic review settings October 9, 2026 06:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation preserves compatibility, remains local-only, and has thorough regression coverage.

0 open findings

What changed in this PR

Adds a Rust-only opt-out for automatic skill reload after resuming a session while preserving existing default behavior.

Changes:

  • Adds ResumeSessionConfig::with_reload_skills(bool).
  • Conditionally skips the post-resume reload without changing wire/AHP configuration.
  • Adds comprehensive resume, callback, cleanup, provider, and serialization tests.
File Description
rust/​src/​types.rs Defines and documents the new configuration option.
rust/​src/​session.rs Applies the option during resume.
rust/​src/​types/​tests.rs Verifies local-only configuration behavior.
rust/​src/​ahp_host/​factory_tests.rs Confirms AHP settings remain unchanged.
rust/​tests/​prepared_session_test.rs Tests ordinary/prepared resume and cleanup behavior.
rust/​tests/​session_test.rs Extends startup callback coverage.
rust/​tests/​skill_provider_test.rs Verifies provider callbacks without automatic reload.
rust/​README.md Documents behavior and limitations.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Chuxel

Chuxel commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

CI diagnosis for f85bf314: nine failed checks are seven Node.js jobs plus two aggregate propagation checks. No rerun or source change.

Failure Affected jobs Concrete cause/evidence
test/rust-codegen.test.ts:986-987, committed-schema discriminator control Four CAPI platforms Hardcoded ../../../../generated/api.schema.json assumes nested runtime layout; standalone checkout resolves outside the repository and fails with ENOENT before generation. The test bypasses the existing layout-aware schema helper.
test/e2e/managed_plugin_progress.e2e.test.ts:118 All seven Node cells Injected policy fixture yields managedSettings.settings === undefined; fails before waiting for plugin-progress completion.
test/e2e/rpc_server.e2e.test.ts:158, sessionless managed settings All seven Node cells Schema/validation calls succeed, but policy resolution returns deviceManaged: false.
sdk-typescript and SDK Result checks Explicit propagation of the failed Linux CAPI result and failed platform composites; no additional test failure.

The exact-base main run 37875911048, at 341a526b, has all the same failure identities and assertion signatures in the same seven Node jobs. The three test blobs are identical base-to-head: 5f34d804 (codegen), aead2b87 (plugin progress), 07d7ffcf (server RPC). Node client/generated RPC and relevant workflows are also unchanged. These are demonstrated baseline defects, not dismissed as flakes or infrastructure noise.

The managed fixtures fail on both published legacy and native transports. CI selects runtime-source: published and downloads the pinned package; SDK child-environment construction preserves the supplied test-hook variables. The runtime-internal reason policy injection is ineffective remains unverified; no compile-time guard is asserted.

In PR run 37894466201, all four actual Rust platform jobs, schema/SDK freshness, and CodeQL passed. The final PR check rollup is 42 successful, 47 skipped, and 9 failed. The PR remains blocked, not CI-green.

Potential Node/layout/policy-fixture maintenance is separately scoped, not added to this Rust PR. No test skips, weakened assertions, retries, or merge bypasses are proposed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Rust callers to omit the automatic post-resume skill reload

2 participants