Skip to content

feat(harness): coordinate durable recorded Assistant continuation [SAP-3292] - #1017

Closed
ynadge wants to merge 1 commit into
assistant-resume-controlsfrom
assistant-continuation-orchestration
Closed

ynadge wants to merge 1 commit into
assistant-resume-controlsfrom
assistant-continuation-orchestration

Conversation

@ynadge

@ynadge ynadge commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Primary change type

  • Feature

Problem and motivation

Continuing from retained history must create one new child, preserve its source, and reconcile lost acknowledgements without duplicating context or native work.

Summary and scope

Coordinate the durable receipt, exact dormant allocator, child association, frozen context acceptance and verified no-reply native seed. Gate Attach until preparation commits. Retry the original operation before consulting newer source records and recheck project/account/native identity throughout. Completed retries use read-only verification and preserve an already-running child's lease; mutating preparation rejects live leases. End also fences final attachment.

Related work

Related issue: https://linear.app/sapiom/issue/SAP-3292

Depends on #1016. Native stack target: main. Routes and production composition follow.

Validation

Continue integration and lifecycle suites — 39 passed
Full Harness server TypeScript, scoped ESLint, git diff --check — passed

Tests and documentation

Eleven integration cases use real receipt, session metadata and accepted-source stores plus the lifecycle coordinator. Cover coalescing, lost accept/seed ACKs, current live retries, missing committed sources, authority/project changes, unavailable activation, and End during preparation or final attachment. Native protocol is separately tested against the selected runtime. Updated assistant-history.md. Increment is below1000 changed lines including tests/docs/changeset; SDK pr:size is absent.

Compatibility and release impact

  • No ordinary prompt, model call, Terminal startup or parent mutation during preparation.
  • Changeset: @sapiom/harness patch.
  • Fix-forward: retain the operation/child identity and fail-closed context checks while correcting orchestration.

Security

  • No secrets, credentials, private data, or unsanitized logs included.
  • No suspected vulnerability disclosed publicly.

AI assistance

  • AI assistance used: Codex implemented orchestration and race tests; independent review identified live-preparation and allocator-rebinding issues addressed here.

Checklist

  • CONTRIBUTING.md read; maintainer-authorized issue work.
  • One focused increment, checks, documentation and release impact addressed.
  • I can explain and maintain the submitted changes.

Devin Review

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1b9c7bd6-976e-49ba-a3b5-d49d4d4714cf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

Comment on lines +197 to +202
if (
receipt?.phase !== "prepared" &&
(state.revision !== request.expectedRevision ||
state.lifecycle === "ending")
)
throw changed();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Source End leaves continuation active

Once receipt.phase is prepared, check ignores a source End and continues attaching the child. The canceled continuation therefore returns a usable child attachment.

Learn more

The receipt becomes prepared before the final source checks and child attachment. From that point, both check and the lifecycle subscriber exempt the operation from source revision and ending-state validation. A concurrent source End can therefore complete while Continue still attaches and returns its child.

Example: Continue finishes seeding and persists phase: "prepared". The user ends the source before lifecycle.attach runs. The source revision advances, but the final checks accept it and Continue returns the child instead of rejecting.

Recommended fix: Keep source End and revision fencing active through the final attachment and return. Remove the prepared-phase exemptions in both check and the lifecycle subscription, while retaining the separate read-only child reconciliation path.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@ynadge ynadge closed this Sep 15, 2026
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.

1 participant