Skip to content

Add schema-discovered repository-backed session creation - #451

Draft
Osvaldo Ortega (osortega) wants to merge 1 commit into
mainfrom
agents/repository-session-config
Draft

Osvaldo Ortega (osortega) wants to merge 1 commit into
mainfrom
agents/repository-session-config

Conversation

@osortega

@osortega Osvaldo Ortega (osortega) commented Sep 16, 2026

Copy link
Copy Markdown

Draft / review status

Draft for human public protocol and SDK review. Three independent model reviews completed with no blocking findings. Live host/client interoperability remains unverified. This PR does not cut a release or change the protocol version.

Summary

  • Add RepositorySessionConfig { urlProperty: string; revisionProperty?: string } and optional SessionConfigSchema.repository.
  • Make the descriptor the opt-in capability. It identifies host-chosen, distinct, declared string fields that are writable for creation and not session-mutable.
  • Carry a credential-free repository URI and optional branch/tag/commit through existing resolveSessionConfig.config and createSession.config. Schema discovery does not prepare a repository. Repository intent and non-empty workingDirectories are mutually exclusive.
  • Document host authorization before side effects, preparation before turns, and recoverable requested intent/resolved directories through existing session state and creating / ready / failed lifecycle. Progress remains optional and ephemeral.
  • Preserve directory/default creation when repository intent is absent, duplicate-creation errors, reattachment after a lost response, and shared/dirty checkout safety during disposal.
  • Regenerate the JSON schemas and all six client mirrors; add a changelog fragment, schema-shape tests, shared wire fixtures, and in-memory SDK tests.

Public client counterpart

microsoft/vscode#336361 is the public draft client implementation for this schema-based flow. The client synchronization uses proposed AHP revision 5eadbe33f6048f748fe42a0a125b96e91414bfdc through the existing generator. Both PRs remain drafts for review.

Validation

  • npm run generate passed; regeneration leaves the committed tree unchanged.
  • cargo check --locked --manifest-path clients/rust/Cargo.toml -p ahp --lib passed, including the generated ahp-types dependency.
  • npm run test passed, including protocol typecheck, lint, fragment/release checks, schema checks, and reducer coverage.
  • The shared wire corpus, including old-schema, URL-only, and URI-plus-revision cases, passed in Rust, Go, Kotlin (JDK 17), Swift, TypeScript, and .NET.
  • Focused TypeScript SDK tests passed for generic config requests and state recovery across success, failure, joining, and snapshot restoration.
  • TypeScript client source typecheck passed. An additional comparison against the unchanged test-file baseline found no new type diagnostics; that existing test file still has 10 diagnostics outside the configured source typecheck.
  • The .NET runner initially ignored the requested VSTest filter and ran all 539 tests successfully. A second run with the runner's supported --filter-class option passed all 48 wire-fixture tests.

Review path (~12 minutes)

  1. Premise and vocabulary (2 min): start with the descriptor and schema. The premise is that existing config and session state can express one-repository creation without a new imperative RPC. Stop here if that premise is wrong.

    The optional repository property is the most important line in this PR. Check that capability discovery does not turn repository input into a global requirement.

  2. Host behavior (4 min): read repository-backed creation in this order: field constraints, input validation, recoverable state, then retry/cleanup. Check the ordering of authorization, preparation, published directories, and readiness; also check what a minimal client can ignore.

  3. Generated wiring (3 min): inspect the five generator registration additions, then the Rust representation and equivalent mirrors. Check optionality, exact wire names, public exports, and .NET serializer registration. TypeScript and reference-doc mirrors remain generated-and-ignored by repository convention.

  4. Tests (3 min): finish with schema-shape coverage, generic SDK config round-trips, and the three new shared fixtures. Check absent descriptors, optional revisions, host-chosen field names, and durable state rather than progress.

Choices to challenge

  • Cross-property references, authorization, URI policy, and side-effect ordering are normative host requirements, not validation performed by generated data types.
  • The new pending-session fixture omits unresolved workingDirectories. An initial empty-array fixture exposed existing Go omitempty behavior; this PR preserves the field's existing optionality rather than changing general Go array serialization. The ready-session fixture still checks resolved directories.
  • Kotlin was checked with a session-local native JDK 17; no container service was started.

Scope and verification limits

This is a creation-only contract for one repository, not project management or a concrete repository-preparation implementation. It adds no RPC, dedicated creation argument, _meta convention, lifecycle state, cancellation command, or protocol version.

Wire and in-memory SDK tests are not live host interoperability evidence. Concrete host authorization, preparation, cleanup, and lost-response recovery still need integration verification.

Old schema payloads remain valid. Older released binaries and all downstream source/binary compatibility were not exercised. In particular, Rust callers constructing SessionConfigSchema with struct literals must supply the new repository member (None for legacy behavior).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant