Repository navigation
canvas: add chat-scoped discovery and URI-addressed lifecycle - #528
Open
Joaquín Ruales (jruales) wants to merge 11 commits into
Open
Joaquín Ruales (jruales) wants to merge 11 commits into
Joaquín Ruales (jruales) wants to merge 11 commits into
Conversation
Joaquín Ruales (jruales)
requested review from
Connor Peet (connor4312) and
roblourens
as code owners
October 14, 2026 21:50
Joaquín Ruales (jruales)
marked this pull request as draft
October 14, 2026 21:51
Joaquín Ruales (jruales)
force-pushed
the
jruales/ahp-canvas-inventory
branch
from
October 14, 2026 22:23
9a3f79a to
37f5151
Compare
Connor Peet (connor4312)
previously requested changes
Oct 14, 2026
Joaquín Ruales (jruales)
force-pushed
the
jruales/ahp-canvas-inventory
branch
from
October 19, 2026 05:37
4493b21 to
d21b6fa
Compare
Joaquín Ruales (jruales)
force-pushed
the
jruales/ahp-canvas-inventory
branch
from
November 3, 2026 00:34
d21b6fa to
c7ecbd7
Compare
Joaquín Ruales (jruales)
marked this pull request as ready for review
November 3, 2026 08:49
Add capability-gated exact-chat listCanvasTypes and openCanvas commands, including owning extension metadata, and regenerate all protocol clients and schemas. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 0a6aa762-4b80-4e33-be5d-68d9f3398af2
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 0a6aa762-4b80-4e33-be5d-68d9f3398af2
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 0a6aa762-4b80-4e33-be5d-68d9f3398af2
Replace snapshot-only Canvas listing with an authoritative exact-chat registry, explicit cold materialization action, and URI-addressed Canvas opening. Normalize provider metadata and update every generated client, reducer, fixture, and specification. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 0a6aa762-4b80-4e33-be5d-68d9f3398af2
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Joaquín Ruales (jruales)
force-pushed
the
jruales/ahp-canvas-inventory
branch
from
November 5, 2026 07:01
c7ecbd7 to
a9c3184
Compare
Joaquín Ruales (jruales)
dismissed
Connor Peet (connor4312)’s stale review
November 6, 2026 00:38
Addressed
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AHP already projects live Canvas instances through
ChatState.canvasesand experimentalahp-canvas:channels, but clients also need an authoritative way to discover the Canvas types available to one exact chat and manage a selected Canvas resource.This PR models discovery as chat state and uses the Canvas channel URI as the resource identity:
ChatState.canvasRegistryis the authoritative exact-chat Canvas type registry.chat/canvasRegistryChangedreplaces or clears that registry when live provider registration changes.chat/canvasRegistryRequestedexplicitly requests potentially effectful materialization for a persisted cold chat.openCanvasuses a client-chosenahp-canvas:URI and separately identifies the owning chat and declaration.disposeCanvascloses that URI-addressed Canvas resource.CanvasExtensionDeclaration; nestedCanvasTypeDeclarationentries usetitleand contain only type-local metadata.AgentCapabilities.canvases.Protocol behavior
Live registry state
For a live chat, the host keeps
canvasRegistrysynchronized with provider registration and emitschat/canvasRegistryChangedonly when the authoritative registry changes. Clients do not poll and do not treat changes to the open-instance list as registry invalidation.The registry distinguishes three states:
{ extensions: [] }: materialized, with no available Canvas types;(extensionId, canvasId).requiresInputremains so clients can exclude declarations whose input flow they do not support. Speculative action metadata is not part of the registry.Cold materialization
When a persisted chat is cold, a client may dispatch
chat/canvasRegistryRequested. The reducer intentionally leaves optimistic state unchanged while the host may resume the backing runtime, discover extensions, and execute extension startup code. The host then publishes the complete result throughchat/canvasRegistryChanged.Materialization must not create a backing for a brand-new chat, send a user message, or invoke a model.
URI-addressed lifecycle
openCanvas.channelis the client-chosenahp-canvas:resource URI. Reusing that URI for the same chat and declaration focuses or refreshes the logical instance; reusing it for a different chat, extension, or Canvas type must fail withConflict.disposeCanvas.channelidentifies the same resource for disposal.CanvasState.instanceIdremains provider-facing correlation metadata; the Canvas URI is the AHP resource identity.sequenceDiagram participant C as Client participant H as Agent Host C->>H: subscribe(chat) H-->>C: ChatState snapshot opt Registry absent and chat persisted C->>H: dispatchAction(chat, canvasRegistryRequested) H->>H: Resume runtime and discover providers H-->>C: action(chat, canvasRegistryChanged) end C->>H: openCanvas(canvas, chat, extensionId, canvasId) H-->>C: action(chat, canvasesChanged) C->>H: subscribe(canvas) H-->>C: CanvasState snapshot C->>H: disposeCanvas(canvas) H-->>C: action(chat, canvasesChanged)Compatibility and generated surfaces
AgentCapabilities.canvasesremain unsupported without probing.1.1.0; this PR does not bump the protocol version.openCanvas/disposeCanvascommand helpers, and Swift dispatchability matches the client-dispatchable registry request.Validation
npm testnpm run docs:buildnpm run typecheck && npm test && npm run buildcargo fmt --all -- --check,cargo clippy --workspace -- -D warnings,cargo test --workspacego build ./...,gofmt -l,go vet ./...,go test ./...swift build && swift test./gradlew build --stacktraceon JDK 17🤖 Written by GitHub Copilot on behalf of Joaquín Ruales (@jruales).