microsoft / microsoft/vscode

Support cross-agent sessions and harness parameter for createSession/createChat

Open
#325,377 0 comments 0 reactions 1 assignee Claimed by @sandy081 View on GitHub
agent-host feature-request
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Problem

Agent Host's session-management tools (createSession/createChat) currently do not provide a robust way to select or pin which agent "harness" (model/runtime/custom agent configuration) should be used for a new session/chat. In practice the createSession tool struggled to resolve the correct model id, and the agent falling back dropped using the specified model rather than resolving the proper id. This makes it hard to create cross-agent sessions or reliably target specific model/harness combinations.

Proposal

1) Add a harness parameter to createSession and createChat
- Provide a first-class `harness` parameter that specifies the agent harness to use when creating a session or chat. The harness should be able to express:
- model (e.g., GPT-5.6, Opus 4.8)
- custom agent identifier (when using a custom configured agent)
- runtime/configuration flags (isolation, sandboxing, resource profile)
- The harness param should allow either a single canonical harness id or a structured object with named fields to make selection explicit.

2) Supplemental tool(s) to enumerate harness options
- Provide one (or two) companion tools to allow clients to discover valid harness options before calling createSession/createChat:
- listHarnesses / getHarnessOptions: returns available harnesses, models, agent ids, and configuration capabilities
- resolveHarness: given a shorthand (e.g., model name + agent name) resolve a canonical harness id and validate constraints
- These tools should expose metadata such as available model versions, whether an agent is custom, supported isolation modes, and any required IDs the createSession API needs.

Why this helps

- Enables cross-agent sessions: callers can explicitly choose which agent/model combination a session should run under (e.g., Copilot:Opus 4.8, Claude:Opus 4.8, Codex:GPT-5.6).
- Prevents fallback behavior that drops model selection: createSession can fail fast or resolve canonical ids via the supplemental tool instead of silently removing the model from the session.
- Improves UX for integrations: chat clients, automated reviewers, and Agent Council workflows can query available harnesses and create sessions with predictable runtime behavior.

Concrete acceptance criteria

- createSession/createChat accept a `harness` parameter (string or structured object) and use it to pin the agent harness for the session/chat.
- New API(s) to list and resolve harness options (listHarnesses, resolveHarness or similar) exist and return machine-readable metadata (model versions, harness id, supported flags).
- When createSession is given a harness shorthand, it attempts to resolve it using resolveHarness and returns a clear error if resolution fails (instead of dropping model information).
- Documentation and examples showing how to create cross-agent sessions and how to query available harnesses.

Example usage

- Query available harnesses:
- listHarnesses() -> [{ id: "copilot:opus-4.8", model: "opus-4.8", agent: "copilot", isolation: "default" }, ...]
- Create a session pinned to a harness:
- createSession({ workspace: "X", harness: "copilot:opus-4.8", startPrompt: "Investigate and fix GH issue" })

Notes / context

- Use-case from chat: "Please have 4 agents review this code change: Claude using Opus 4.8; Codex using GPT-5.6; Copilot using Opus 4.8; Copilot using GPT-5.6" — this is exactly the kind of cross-agent orchestration that requires deterministic harness selection.
- The current createSession implementation struggled to resolve the correct model id; rather than resolving, the agent dropped the model selection. A resolve step or a deterministic harness id would avoid this.

Please assign to @TylerLeonhardt (requested).

[View original Slack conversation](https://vscodeteam.slack.com/archives/C0AKR94N3CK/p1783602698566629?thread_ts=1783602698.566629&cid=C0AKR94N3CK)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.