Skip to content

Add repository preparation and rich working directories - #451

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

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

Conversation

@osortega

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

Copy link
Copy Markdown

Summary

  • Keep typed repository lists on creation and configuration queries; add optional repository-relative subdirectory selection.
  • Publish actual URI-keyed working directories with optional source association and host-owned local/repo/worktree provenance. Remove repository-input echoes from session metadata.
  • Negotiate rich records with ClientCapabilities.workingDirectoryInfo; preserve URI-only projection on every snapshot, catalogue, action, and reconnect carrier.
  • Update all six SDK reducers and generated types. Preserve existing primary-directory rules and duplicate-create errors; no creation token or automatic recovery from a duplicate.

Protocol contract and request/result example.

Validation

  • Full generation and required npm test: 495 passed.
  • Full Rust workspace: 88 passed, including doctests.
  • All six client corpora: 291 reducer fixtures and 78 wire fixtures; targeted TypeScript client checks: 64 passed.
  • Changed directory reducer paths: 30/30 covered. Whole session-reducer coverage is 97.18%; remaining uncovered paths are existing customization branches.

Head: 0ceeb99be0ac7821d1f4ca887ed5771a6e15391a; includes main ba231a0381bc1c7dc9b584cb0f6a5d8b9165c47f through normal signed merges/commits. Exact-head CI passed all seven language/check jobs (run 35665701843). The external VS Code PR Check is still running.

Protocol/client conformance only: no live-product validation, new preparation engine, generic worktree creation, or Rift backend is claimed. Related public client PR: microsoft/vscode#336361.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use optional repositorySource and repositoryRevision values in the existing session config flow. Remove the unreleased descriptor, key mapping, exports, and generator registrations while retaining host-owned preparation, lifecycle, and recovery semantics. Update generated mirrors, documentation, and shared wire and SDK coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
@osortega Osvaldo Ortega (osortega) changed the title Add schema-discovered repository-backed session creation Standardize repository-backed session configuration keys Sep 17, 2026
Replace repeated configuration rules with links to the shared schema documentation and keep progress guidance operation-neutral. Retain the normative specification and the source/directory, readiness, and disposal safeguards.

Regenerate SDK comments and schema descriptions without changing declarations or wire structure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
Move repository source and revision out of provider configuration into existing request types and immutable session metadata. Advertise source and revision support explicitly through agent capabilities and keep the preparation lifecycle unchanged.

Regenerate all SDKs and schemas, and cover typed requests, capability discovery, and recoverable state in shared wire fixtures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
@osortega Osvaldo Ortega (osortega) changed the title Standardize repository-backed session configuration keys Add typed repository source inputs and session metadata Sep 18, 2026
Initialize the new optional source and revision fields in reducer, client and multi-host fixtures so cargo test --workspace compiles all targets. This changes tests only; generated protocol types and the wire contract are unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
Include main 27207ea while preserving typed repository intent and upstream lightweight chat catalogs. Regenerated mirrors match the merge; protocol, full Rust workspace, and all six client wire checks pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🫣

Comment thread types/channels-session/state.ts Resolved
Comment thread types/channels-session/state.ts Resolved
Comment thread types/channels-session/commands.ts Resolved
Comment thread types/channels-root/state.ts Resolved
Comment thread types/channels-root/notifications.ts Resolved
Comment thread types/channels-root/commands.ts Resolved
Group repository source and optional revision into typed lists on creation, configuration queries, and immutable session metadata. Advertise host-owned preparation on initialize, with single-repository support unless multipleRepositories is enabled.

Restore generic configuration, disposal, and progress comments. Preserve exact repository intent through lifecycle recovery, and regenerate all client types with shared wire and reducer coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
@osortega Osvaldo Ortega (osortega) changed the title Add typed repository source inputs and session metadata Add repository lists and host preparation discovery Sep 21, 2026
Comment thread types/channels-session/commands.ts Resolved
Comment thread types/channels-root/commands.ts Resolved
Comment thread types/common/commands.ts Resolved
Restore pre-existing comments and keep new field descriptions brief. Leave the detailed contract in the session specification. Generated comments and schema descriptions are refreshed; declarations and validation are unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
@connor4312

Copy link
Copy Markdown
Member

Some questions/comments:

  • It'd be nice if we can extend this later to have first class worktree support for local AH! Also thinking about about worktree-style operations that aren't necessarily using git worktrees, like rift and similar
  • We say that repositories are present "instead of an explicit workingDirectories list", but this seems to prevent the ability to create sessions in subdirectories of repositories, which is a popular monorepo scenario
  • We have existing capabilities around the mutability of working directories--adding or changing them. Are these operations similarly 'banned' for any session with a repositories list?
  • We should document (in .md) the expectations around what hosts do here when presented with repositories, there appears to be some subtlties in the lifecycle about when the repository is "prepared"

Comment thread types/channels-session/state.ts Resolved
@osortega
Osvaldo Ortega (osortega) marked this pull request as draft September 21, 2026 21:16
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
Support repository subdirectory selection and opt-in URI-keyed directory records. Update generated SDKs, reducers, compatibility documentation, and shared conformance fixtures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
@osortega

Copy link
Copy Markdown
Author

Connor Peet (@connor4312) Updated in 0ceeb99: repositories[].subdirectory selects a monorepo folder; resolved directories carry host-owned source/provenance metadata. Existing directory mutation and primary-slot rules are unchanged. The spec covers preparation, readiness, compatibility, and lost creation responses. This describes results; it does not add generic worktree creation or a Rift backend.

@osortega Osvaldo Ortega (osortega) changed the title Add repository lists and host preparation discovery Add repository preparation and rich working directories Sep 21, 2026
@osortega
Osvaldo Ortega (osortega) marked this pull request as ready for review September 21, 2026 23:04
Osvaldo Ortega (osortega) added a commit to microsoft/vscode that referenced this pull request Sep 21, 2026
Keep repository selection as creation input and publish URI-keyed directory associations and preparation provenance. Preserve URI-only peers across live state, listings, reconnects and cached workspaces.

Support repository subdirectory selection and require explicit reopening after duplicate creation, without changing native deferred first-turn startup. Sync microsoft/agent-host-protocol#451 at 0ceeb99be0ac7821d1f4ca887ed5771a6e15391a.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 79731f48-d288-483f-8809-136aa141d1eb
@osortega
Osvaldo Ortega (osortega) marked this pull request as draft September 22, 2026 00:18
Copilot AI added 4 commits November 10, 2026 22:56
Resolve conflicts from 152 upstream commits and regenerate every client
from the merged types/.

- Keep both sides in the command/union registries of each generator
  (WorkingDirectoryOrigin beside BackgroundWork and
  AutomationDisableCondition; RepositorySource beside
  CreateTcpConnectionParams); combine the Go presence-sensitive
  collection rule with upstream's new cases.
- Union the per-client round-trip fixture dispatch tables and drop the
  SubscribeResult/ReconnectResult cases that main added independently.
- Merge the JSON Schema test harness (minItems check alongside upstream's
  optional items/maximum/minLength handling).
- Regenerate schema/, docs, and all six client mirrors.
- Point spec links at the generated command anchors
  (#createsession, #resolvesessionconfig, #sessionconfigcompletions).
An omitted or empty `repositories` list requests no repository
preparation; hosts no longer reject `[]`. Remove the generator's
`@minItems` support added only for these fields, update the spec prose
and schema tests, and regenerate the client mirrors.
Resolve conflicts from the 1.1.0 release and the 41 upstream commits that
followed; regenerate every client from the merged types/.

- Keep both sides in each generator's enum/struct registries
  (WorkingDirectoryOriginKind beside ChangesetFileStatus; RepositorySource
  and RepositoryPreparationCapabilities beside CreateTcpConnectionResult
  and HostEnvironment).
- Union the Rust/TypeScript round-trip harness imports with upstream's
  AuthenticateParams additions.
- Keep both the repository-list and account-selection JSON Schema tests.
- Rename `RepositoryPreparationCapabilities` to
  `RepositoryPreparationCapability`: it is one capability with options,
  not a group.
- Model `ClientCapabilities.workingDirectoryInfo` as a presence-only
  `WorkingDirectoryInfoCapability {}` instead of `Record<string, never>`.
  The wire shape (`{}`) is unchanged.
- Drop the Go generator's `Record<string, never>` pointer rule, which
  only existed for `workingDirectoryInfo` and had changed the Go types of
  unrelated `mcpApps`, `review`, and `logging` fields; narrow fixture 059
  to the capability this change introduces.
- Register the new type in every generator, document both types in the
  reference, and link them from the specification.

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.

5 participants