Skip to content

protocol: add optional initial chat titles - #526

Merged
Don Jayamanne (DonJayamanne) merged 5 commits into
mainfrom
copilot/fork-prompt-exploration-ahp
Oct 17, 2026
Merged

Don Jayamanne (DonJayamanne) merged 5 commits into
mainfrom
copilot/fork-prompt-exploration-ahp

Conversation

@DonJayamanne

@DonJayamanne Don Jayamanne (DonJayamanne) commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add an optional initial display title to createChat, supporting named forks in Agent Host clients.

  • Add optional createChat.title without a new capability or prescribed title-formatting/naming behavior.
  • Reuse the existing initialMessage field for prompted forks; no new RPC error.
  • Update the creation field list, generated schemas/native models, shared round-trip fixtures, native Kotlin constructor coverage, and one shared initial-title changelog fragment.
  • Following the later review, remove the redundant explanatory paragraphs, the generated-Kotlin source-text ordering test, and the separate Kotlin/Go/Rust changelog fragments.

Tracks microsoft/vscode#341229.
Companion implementation: microsoft/vscode#341230.

Compatibility

Older hosts can ignore the optional title field. Source-based creation continues to use the existing fork and sideChat capabilities; there are no additional title or initial-message capabilities and no protocol version bump.

The title remains a trailing optional constructor property where supported. The shared change fragment covers the protocol and generated clients; there are no per-client migration changelogs.

Validation

Latest three-comment review cleanup:

  • npm run generate — passed; no changes to tracked canonical types, schemas, or native client outputs.
  • npm test — typecheck, lint, release metadata, changelog/fragments, and generated-output checks passed. The final test invocation was blocked by the local npx executable's execute permission.
  • The remaining test stage was run via the equivalent command below — 516 tests passed, 100% reducer branch coverage:
npm exec -- c8 --include types/reducers.ts --check-coverage --branches 100 \
  tsx --test types/*.test.ts types/version/*.test.ts \
  clients/dotnet/codegen/telemetry/*.test.ts scripts/*.test.ts
  • git diff --check — passed.
  • git diff --exit-code -- types schema clients — passed after generation; the review cleanup changes no protocol or generated SDK code.
  • A TypeScript AST-printer comparison of canonical and VS Code vendored CreateChatParams — identical. These deleted docs/test/changelog files have no VS Code vendored counterpart, so no VS Code source change is required.

Earlier validation on the same protocol/native-client code (not rerun for this docs/test deletion): TypeScript client 77 tests/build, Rust workspace tests, Go tests, and Swift build passed. Swift tests were blocked by missing XCTest; Kotlin and .NET toolchains were unavailable locally. Fresh PR CI remains the cross-language confirmation.

Add an optional createChat title and initialTitle capability, regenerate client models, and cover cross-language round trips and constructor compatibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Define composed fork acceptance and rejection semantics while preserving legacy initialMessage behavior. Update generated client models, schemas, documentation, and round-trip coverage.

Refs microsoft/vscode#341229

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread types/channels-chat/commands.ts Outdated
Comment thread types/channels-chat/commands.ts Outdated
Comment thread types/channels-chat/commands.ts Outdated
Comment thread types/channels-root/state.ts Outdated
Comment thread types/channels-root/state.ts Outdated
Comment thread types/channels-root/state.ts Outdated
Comment thread types/common/errors.ts Outdated
Keep title optional without new capabilities or naming mandates. Reuse normal turn errors for initial messages and regenerate the schemas and clients. Update compatibility fixtures and the TypeScript round-trip dispatcher.

Addresses review on #526; companion implementation microsoft/vscode#341230.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Don Jayamanne (DonJayamanne) added a commit to microsoft/vscode that referenced this pull request Oct 13, 2026
Use the existing fork capability and optional title field. Report initial-message failures in the target turn and persist rejected turns across reload. Remove special rejection draft recovery while keeping unknown-outcome inspection and no-resend behavior.

Replicates microsoft/agent-host-protocol#526 review changes for #341230.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@DonJayamanne Don Jayamanne (DonJayamanne) changed the title protocol: support named and prompted chat forks protocol: add optional initial chat titles Oct 13, 2026
Comment thread docs/specification/chat-channel.md Outdated
Comment thread scripts/kotlin-constructor-order.test.ts Outdated
Comment thread docs/.changes/20261006-rust-initial-title-struct-fields.json Outdated
Remove redundant creation prose, the generated Kotlin source-order test, and per-client changelog fragments. Keep the shared title change note, native constructor compatibility coverage, and protocol definitions unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve initial-title round-trip coverage alongside upstream subscription, reconnect, and TCP fixtures. Regenerate protocol outputs without restoring removed review-only tests or per-client changelogs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@DonJayamanne
Don Jayamanne (DonJayamanne) merged commit 1ef0642 into main Oct 17, 2026
9 checks passed
@DonJayamanne
Don Jayamanne (DonJayamanne) deleted the copilot/fork-prompt-exploration-ahp branch October 17, 2026 05:19
Don Jayamanne (DonJayamanne) added a commit to microsoft/vscode that referenced this pull request Oct 18, 2026
* agentHost: support named fork titles

Carry optional fork titles through Agent Host transports and both VS Code session surfaces, advertise support explicitly, and preserve ordinary forks for older hosts.

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

* chat: update fork test for connections service

Adapt the named-fork slash-command test to the new Agent Host connections service constructor dependency introduced upstream.

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

* agentHost: support prompted forks

Add prompt-bearing Agent Host forks, preserve source-turn context, generate context-aware titles, and expose completion templates with argument hints and recovery behavior.

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

* agentHost: adapt fork title test to utility model service

Use the upstream utility-model test adapter after rebasing prompted forks.

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

* chat: distinguish fork completion descriptions

Localize the named and prompted fork descriptions for #341229.

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

* chat: preserve fork context and drafts across asynchronous creation

Address review feedback for #341230: resolve streaming fork boundaries, retain inherited agent selection, identify in-flight operations without serializing attachments, parse prefixed titles, and protect edited attachment drafts.

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

* Fix fork CI regressions after upstream sync

Guard fork-only draft inspection before accessing the composer. Update title tests for normalized storage and explicit user title ownership, and correct test formatting.

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

* agentHost: drain session metadata before idle eviction

Wait for pending normalized metadata and migration writes before dropping resident state, scoped to the released session. Preserve write error reporting and cover command and client renames across restoration.

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

* agentHost: align fork titles and errors with protocol review

Use the existing fork capability and optional title field. Report initial-message failures in the target turn and persist rejected turns across reload. Remove special rejection draft recovery while keeping unknown-outcome inspection and no-resend behavior.

Replicates microsoft/agent-host-protocol#526 review changes for #341230.

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

* agentHost: drop changes unrelated to named and prompted forks

Revert 29e29e2 (session metadata drain before idle eviction). The race it
fixes is reached through the pre-existing rename paths and is independent of
forking; it is tracked separately.

Also remove the unused startClientTurnMessage overload, collapse the
single-field ICapturedForkInitialMessage wrapper, drop a stray blank line, and
right-size the fork accessibility help to match the surrounding entries.

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

* chat: surface the real cause when a prompt fork fails

The unknown-outcome notification hid the underlying error, so definite
pre-creation failures (for example "Wait for workspace setup to finish")
were reported only as an unknown outcome. Include the cause in the message.

Inspect Target waited for a chat that may never appear and then returned
silently. Report that failure instead.

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

* agentHost: persist only rejections the submitter cannot recover

Rejected turns were made durable for every chat so a rejected fork prompt
would survive a reload. Ordinary rejections leave the message in the client's
composer, so persisting them kept records nothing needs.

Follow the resumable precedent on the error variant: the rejected variant now
carries recoverable, producers default to recoverable, and only the create-chat
initial message opts out.

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

* Revert "agentHost: drop the session metadata drain"

Restores 29e29e2. CI proves the drain is load-bearing for this branch:
runs 508c2b9 and 30baf6d (no drain) failed `peer chat catalog and
transcript survive a host restart`, 29e29e2 (drain) was fully green, and
4aeb97e (drain reverted) failed again on Linux and Windows. The same test
passes on contemporaneous unrelated pull requests.

The underlying race is pre-existing and remains tracked separately, but this
branch triggers it reliably, so the ordering fix stays here.

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

* agentHost: drain session catalog writes before idle release

Keep legacy chat restoration from reading an older catalog while an accepted rename is still being synchronized. Drain the session's catalog and passive metadata writes before releasing it, and scope their rejecting peer-write barriers to that session.

Cover compatibility-storage renames and scoped write errors. Keep the existing restart assertion unchanged and synchronize the ordered-catalog test on its actual summary notification.

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

---------

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.

2 participants