Question
Port the delivery engine (src/delivery/) from v1's synthetic-part injection via the chat.message hook to v2's primitives:
- Durable delivery (session-durable rules): v1 appended a synthetic text part to the user message via
chat.message; v2 uses ctx.session.synthetic({ sessionID, text, metadata?, delivery?: "steer"|"queue" }). Verify: does steer/queue delivery timing match v1's "append to current user message before dispatch" semantics? If not, choose the closest and document the divergence.
- Transient delivery (ephemeral rules: agent/model/branch/tools): v1 used
experimental.chat.messages.transform (one transient message per matching turn); v2 equivalent is the ctx.session.hook("context", ...). It runs per model dispatch (incl. tool continuations and compaction) and is never persisted — verify our "one transient message per matching turn" logic works against a per-dispatch-not-per-turn hook (may inject on tool continuations too; decide accept/adjust).
- Awaited no-reply admission (durable rule first matched by live File observation): v1
session.prompt with noReply → v2 ctx.session.prompt(..., { resume: false }). Keep transient fallback + retry-when-persistence-fails semantics.
- Preserve the existing codec/history-port (
src/delivery/codec.ts, history port) or replace them if v2's session.context() read makes them obsolete.
Question
Port the delivery engine (
src/delivery/) from v1's synthetic-part injection via thechat.messagehook to v2's primitives:chat.message; v2 usesctx.session.synthetic({ sessionID, text, metadata?, delivery?: "steer"|"queue" }). Verify: doessteer/queuedelivery timing match v1's "append to current user message before dispatch" semantics? If not, choose the closest and document the divergence.experimental.chat.messages.transform(one transient message per matching turn); v2 equivalent is thectx.session.hook("context", ...). It runs per model dispatch (incl. tool continuations and compaction) and is never persisted — verify our "one transient message per matching turn" logic works against a per-dispatch-not-per-turn hook (may inject on tool continuations too; decide accept/adjust).session.promptwith noReply → v2ctx.session.prompt(..., { resume: false }). Keep transient fallback + retry-when-persistence-fails semantics.src/delivery/codec.ts, history port) or replace them if v2'ssession.context()read makes them obsolete.