Skip to content

feat(work-runs): hand off remote conversation turns - #946

Closed
Neonforge98 wants to merge 2 commits into
codex/cloud-conversation-runtime-adapterfrom
codex/work-item-conversation-handoff
Closed

feat(work-runs): hand off remote conversation turns#946
Neonforge98 wants to merge 2 commits into
codex/cloud-conversation-runtime-adapterfrom
codex/work-item-conversation-handoff

Conversation

@Neonforge98

Copy link
Copy Markdown
Collaborator

Problem

A Work Item discussion Run can target a cloud-shared root Session that is owned by another member and therefore does not exist in the comment sender’s local Session store. The durable dispatcher currently treats that root like a normal local resume target, so delivery fails instead of handing execution to the sender’s own local continuation. A simple frontend event is not sufficient: acceptance, runner preparation, transport acceptance, and outbox acknowledgement must share one fenced identity or a crash can duplicate or lose the turn.

Solution

Add a backend-only remote-root hand-off protocol on top of the existing WorkItemRun outbox. The dispatcher preserves the immutable shared root, emits a claim-token-fenced offer, keeps the lease alive while a capable frontend window queues/setup/sends, durably prepares the exact local runner before send, and marks delivery only after the exact Run intent is accepted. Reclaims reuse a prepared runner hint, stale windows cannot prepare or acknowledge, terminal-before-ack retires the outbox atomically, and retries never promote the hidden runner into the shared root target. Existing local native and CLI resume paths continue through the same dispatcher acknowledgement helper. Typed Tauri RPCs expose accept/release/nack/prepare/ack for the next stacked frontend bridge. Team Chat is untouched.

Potential risks

  • The local project database gains one nullable claim_token column on pm_dispatch_outbox; schema initialization upgrades existing databases idempotently.
  • Until the next stacked frontend-listener PR lands, a remote-root offer has no capable listener and follows the bounded timeout/retry path rather than being falsely acknowledged. Local Session delivery is unchanged.
  • The claim heartbeat is deliberately finite (20 minutes); a turn still queued after that horizon is fenced and re-offered.

Validation

  • cargo test -p project_management --no-fail-fast (626 passed)
  • cargo test -p agent_core conversation_turn_bridge --no-fail-fast (9 passed)
  • cargo test -p agent_core work_item_run_dispatcher --no-fail-fast (3 passed)
  • cargo check -p org2
  • pnpm exec tsc --noEmit --pretty false
  • scoped ESLint and Prettier checks
  • repository pre-commit hooks: lint-staged, TypeScript, Clippy (agent_core, project_management), ESLint/circular stats

Stack

Base: #945 (codex/cloud-conversation-runtime-adapter). The next PR installs the thin Work Item frontend listener using the shared cloud runtime adapter and persistent continuation runner.

@Harry19081 Harry19081 added enhancement New feature or request agent Agent runtime, behavior, memory, providers, or orchestration project-management Projects, work items, routines, GitHub work, or team inbox labels Aug 25, 2026
@Neonforge98

Copy link
Copy Markdown
Collaborator Author

Superseded by the final two-PR design: #844 removes the Work Item-specific remote continuation bridge, and stacked #939 keeps the reusable audience routing plus sender-local provider-native continuation. This dispatcher/store/handoff stack is intentionally retired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Agent runtime, behavior, memory, providers, or orchestration enhancement New feature or request project-management Projects, work items, routines, GitHub work, or team inbox

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants