Preserve multi-turn context across Provider handoff - #18
Conversation
|
Audit follow-up commit \68ee843\ is ready. Both required CI checks are green, and Issue #17 now records the clarified disclosure, source-scope, receipt, and bounded-snapshot semantics. @i-so-late, could you review the updated PR when convenient? I will use the repository's normal squash-merge path after approval. |
0f9613f to
68ee843
Compare
68ee843 to
3c8d0f0
Compare
|
Maintainer self-review complete: no blocking findings remain. The Host sends the authorized task separately from exact current wording and a bounded six-message/2000-character role-labelled checkpoint. Delta is permitted only for the same typed Provider Session, the same dialogue-source scope, a native delivery receipt, and one unique full-text anchor; missing, clipped, ambiguous, failed-before-delivery, or cross-source cases fall back to the bounded snapshot. Receipt authority remains internal: it does not enter Runtime events/results, WebSocket/Electron Work projections, Work Activity, Provider Activity journal, visible timestamps, or the public event sequence. Self-review added two corrections before merge: ARCHITECTURE/current-contract documentation for the disclosure boundary, and a regression that keeps internal receipts out of the public event cursor. Validation in the formal .venv_cu124 environment on the rebased merge train: full pytest 1719 passed / 1 skipped; after the final event-sequence correction, 29 direct and 277 combined handoff+narration tests passed. The deterministic A/B/C provider-neutral probe, changed-surface Ruff/compile/diff checks, Electron tests (2/2), TypeScript/Vite production build, provenance gate, and deterministic source-release gate passed. Required build and cpu-model-less checks are green on final head 3c8d0f0. Admin merge bypass is used only for the unavailable external approval requirement. |
中文摘要
关联讨论:#17。
What and why
Provider delegation lost the multi-turn object when the current user message was an anaphoric follow-up, and recovery could omit parent context entirely. The initial repair improved the normal path but an independent audit found two unsafe cursor cases and two residual presentation/activity leaks.
This PR now repairs the complete Host-owned handoff boundary:
Linked product-semantic discussion: #17
Fixes #17
Product semantics
This is a bounded product-semantic and data-disclosure change, not only an internal optimization.
A model-driven Provider receives the exact current user wording plus up to six recent User/Main Chat messages and 2000 characters from the dialogue source that owns the turn. For an external selected Provider, that bounded text leaves the Host with the authorized Work request. This can change model behavior, prompt tokens, latency, cost, and disclosed data.
Prior Main Chat text is labelled evidence, not another task, permission, receipt, or completion fact. Host task, workspace, permission, completion, and acceptance authority remain unchanged. Prompt wording alone is not proof of real-model interpretation.
Dialogue-source scope protects handoff provenance and delta calculation; it is not native-history isolation. Provider Sessions remain WorkItem-scoped, so the same WorkItem may reuse its native thread across Chat/A1 sources while receiving a bounded
snapshot_fallbackfrom the current source.The bounded snapshot is best-effort recoverability within its window, not complete conversation memory.
Change class
Owning layers: Chat source projection, Provider Runtime native-acceptance boundary, Work Ledger delivery cursor, and public Provider/Electron presentation projections.
Compatibility or migration impact: no database migration or Provider capability change. Provider-visible prompt content and disclosure are intentionally broader and documented.
Evidence
python tools/probes/probe_provider_parent_context_handoff.pycu124Python suite: 1689 passed, 1 skipped.git diff --checkpassed.No paid live-model run was used. Real Provider interpretation of Main Chat evidence and measured token/latency savings remain outside the current evidence.
npm testandnpm run buildpassFinal check