Add durable error response parts and turn resume - #390
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds durable turn-error response parts and resumable errored turns across the protocol and generated clients.
Changes:
- Introduces
ErrorResponsePartandchat/turnResume. - Updates reducers and fixtures for resume eligibility and error preservation.
- Regenerates schemas, SDK models, documentation, and changelog metadata.
Show a summary per file
| File | Description |
|---|---|
types/version/registry.ts |
Registers the resume action for protocol 0.8. |
types/test-cases/reducers/270-chat-responsepart-cannot-append-error.json |
Tests rejecting generic error-part appends. |
types/test-cases/reducers/269-chat-turn-resume-completes-one-turn.json |
Tests completing a resumed turn. |
types/test-cases/reducers/268-chat-turn-resume-preserves-errors-across-retries.json |
Tests preserving repeated errors. |
types/test-cases/reducers/267-chat-turn-resume-noop-for-unresumable-error.json |
Tests unresumable-error rejection. |
types/test-cases/reducers/266-chat-turn-resume-noop-for-nonlatest-turn.json |
Tests stale-turn rejection. |
types/test-cases/reducers/265-chat-turn-resume-noop-for-unknown-turn.json |
Tests unknown-turn rejection. |
types/test-cases/reducers/264-chat-turn-resume-noop-with-active-turn.json |
Tests active-turn rejection. |
types/test-cases/reducers/263-chat-turn-resume-reopens-turn.json |
Tests reopening an errored turn. |
types/test-cases/reducers/250-turncomplete-force-cancels-auth-required-tool-call.json |
Updates completed-turn expectations. |
types/test-cases/reducers/240-turn-duration-is-clamped-to-zero.json |
Updates completed-turn expectations. |
types/test-cases/reducers/161-chat-turn-lifecycle-on-chat.json |
Updates lifecycle expectations. |
types/test-cases/reducers/107-session-input-turn-end-cleans-turn-scoped-only.json |
Updates finalized-turn expectations. |
types/test-cases/reducers/099-endturn-force-cancels-running-tool-call.json |
Updates completed-turn expectations. |
types/test-cases/reducers/070-full-turn-flow-with-tool-calls-and-re-confirmation.json |
Updates full-flow expectations. |
types/test-cases/reducers/017-turncomplete-force-cancels-in-progress-tool-calls.json |
Updates completed-turn expectations. |
types/test-cases/reducers/016-session-error-finalizes-turn-with-error.json |
Moves errors into response parts. |
types/test-cases/reducers/015-session-turncancelled-finalizes-turn.json |
Removes obsolete null error state. |
types/test-cases/reducers/014-session-turncomplete-finalizes-turn.json |
Removes obsolete null error state. |
types/common/actions.ts |
Adds the resume action to common unions. |
types/channels-chat/state.ts |
Defines durable error response parts. |
types/channels-chat/reducer.ts |
Implements error finalization and resume behavior. |
types/channels-chat/actions.ts |
Defines error and resume action contracts. |
types/action-origin.generated.ts |
Marks resume as client-dispatchable. |
scripts/generate-swift.ts |
Adds Swift generation metadata. |
scripts/generate-rust.ts |
Adds Rust generation metadata. |
scripts/generate-kotlin.ts |
Adds Kotlin generation metadata. |
scripts/generate-go.ts |
Adds Go generation metadata. |
schema/state.schema.json |
Adds error-part state schema. |
schema/notifications.schema.json |
Propagates error-part definitions. |
schema/errors.schema.json |
Propagates action and error schemas. |
schema/commands.schema.json |
Propagates action and response schemas. |
schema/actions.schema.json |
Defines updated chat action schemas. |
docs/specification/chat-channel.md |
Documents recovery semantics and validation. |
docs/guide/state-model.md |
Documents durable errors in state. |
docs/guide/actions.md |
Lists the new resume action. |
docs/.changes/20260811-error-response-parts-and-turn-resume.json |
Records the user-visible change. |
clients/swift/AgentHostProtocol/Tests/AgentHostProtocolTests/ReducersTests.swift |
Tests resume dispatchability. |
clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/ToolCallStateExtensions.swift |
Handles the new response variant. |
clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Reducers.swift |
Implements Swift reducer behavior. |
clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift |
Regenerates Swift state models. |
clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/Actions.generated.swift |
Regenerates Swift actions. |
clients/rust/crates/ahp/src/reducers.rs |
Implements Rust reducer behavior. |
clients/rust/crates/ahp-types/src/state.rs |
Regenerates Rust state models. |
clients/rust/crates/ahp-types/src/actions.rs |
Regenerates Rust actions. |
clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/Reducers.kt |
Implements Kotlin reducer behavior. |
clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt |
Regenerates Kotlin state models. |
clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/Actions.generated.kt |
Regenerates Kotlin actions. |
clients/go/ahptypes/state.generated.go |
Regenerates Go state models. |
clients/go/ahptypes/actions.generated.go |
Regenerates Go actions. |
clients/go/ahp/reducers.go |
Implements Go reducer behavior. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 47/51 changed files
- Comments generated: 5
- Review effort level: Balanced
Connor Peet (connor4312)
previously approved these changes
Aug 21, 2026
Connor Peet (connor4312)
left a comment
Member
There was a problem hiding this comment.
this is looking nice now in general
Connor Peet (connor4312)
previously approved these changes
Aug 24, 2026
roblourens
added a commit
that referenced
this pull request
Aug 25, 2026
Integrate durable error response parts and turn resume with latest main, preserve deterministic reducer timestamps, restore all client builds, and require protocol 1.0 for the breaking chat/error wire shape.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Represent turn failures as durable response parts, allow resumable failures to reopen the same turn, and keep reducer behavior consistent across generated clients.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
force-pushed
the
roblou/agents/error-recovery-actions
branch
from
August 25, 2026 19:13
5c2db70 to
63ecf7a
Compare
roblourens
marked this pull request as ready for review
August 25, 2026 19:14
roblourens
enabled auto-merge (squash)
August 25, 2026 19:14
Benjamin Christopher Simmonds (benibenj)
approved these changes
Aug 25, 2026
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
ErrorResponsePartentries in the response stream while retainingTurnState.Erroras the top-level terminal signal.resumable: true; clients decide whether and how to present a resume affordance.chat/turnResumeaction, which reopens the latest resumable errored turn with the same turn ID, message, response parts, and usage—without adding a synthetic message or turn.Semantics
The host accepts
chat/turnResumeonly when no turn is active, the requested turn is the latest turn, that turn is errored, and its final response part is resumable. Invalid or stale resume actions are rejected before provider side effects run.Minimal clients can ignore
resumableand continue rendering a coherent terminal error. Clients that support resume can render any appropriate affordance and dispatchchat/turnResumewhen the user invokes it.Validation
npm test: 396 passing with 100% reducer branch coverage.cargo check --tests.(Written by Copilot)