Skip to content

ask_user posts the question and ends the turn; delete the message_response delta (CL-7443) - #641

Merged
TheGreatAxios merged 9 commits into
mainfrom
cl-7443-ask-user-ends-turn
Sep 5, 2026
Merged

TheGreatAxios merged 9 commits into
mainfrom
cl-7443-ask-user-ends-turn

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes CL-7443

ask_user posts its question and ends the turn instead of parking on a
message_response gate/signal. CL-7190's local delta is retired from
@intx/inference and @intx/types.

Critique follow-ups (this update)

  1. vendor/intx/inference/src/reactor.ts pristine. The file still
    carried the retired message_response resume branch
    (resumePendingOperation/timeoutMessageFor) even though the ledger
    already claimed zero local delta. Replaced byte-for-byte with upstream
    a8bc06ae's packages/inference/src/reactor.ts; recomputed the
    scripts/checks/kill-dates.txt tree hash.
  2. vendor/intx/types/src/signals.test.ts removed. This PR had added a
    test file at an upstream-owned path with content that diverges from
    upstream's own signals.test.ts — not something Workbench vendors.
    Deleted; signals.ts itself was already byte-identical to upstream.
  3. Dropped pending ops on warm-agent restore. A warm agent's
    persisted checkpoint/WAL can still carry a message_response pending
    op from before this change. Left alone, the reactor's
    rehydrateGates throws Unclassified signal kind on every respawn.
    conversation-state.ts's restore path now drops any pending op whose
    kind isn't a current SignalKind, reporting each drop through
    reportError (operation: pending_op_dropped_unknown_kind). Covered
    by a checkpoint fixture test. Documented in docs/CHAT.md: an
    in-flight question at deploy time is simply lost, the person's answer
    becomes an ordinary next turn.
  4. ask_user's postQuestion failure now reports. Replaced the
    report-error-ignore on packages/interaction-tools/src/tool.ts's
    catch with a real reportError(err, { operation: "ask_user_post_question", agentId }) before returning the error
    result.
  5. Runtime doesn't enforce the stop instruction. Added a test
    asserting the tool result text tells the model to end its turn, and
    a docs/CHAT.md note that this is plain instruction text, not
    something the runtime enforces.

All fixed as separate tests-first/implementation commits. bun run check:structural, typecheck, and targeted tests pass locally; CI is
authoritative.

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

CL-7443

@TheGreatAxios
TheGreatAxios force-pushed the cl-7443-ask-user-ends-turn branch 2 times, most recently from d61ee4d to c5d03dd Compare September 5, 2026 01:28
ask_user's beforeToolExtension-based suspend/gate mechanism is retired in
favor of posting the question and returning an end-turn instruction from
run(); update its tests accordingly, retire the message_response-specific
reactor suspend/resume regression harness (CL-7190), and add coverage that
SignalKind now accepts only approval.
…ponse delta

A Workbench agent is an unbounded interactive step: every inbound mail is
its own next turn. The native "ask a person" is therefore to post the
question and end the turn, not to structurally park it on a gate — the
person's reply already arrives as the agent's next turn.

ask_user no longer contributes a beforeToolExtension: it posts the
question card from a plain run() and returns immediately with a tool
result instructing the model to end its turn, since the answer is not
this call's result but the agent's next inbound message.

This retires CL-7190/CL-7191's message_response vendored delta: the
signal kind is gone from vendor/intx/types/src/signals.ts (back to
upstream's approval-only shape), its resume branch is gone from
vendor/intx/inference/src/reactor.ts, and the correlationId plumbing that
only existed to resolve it is gone from vendor/intx/hub-sessions'
sendUserMessage and every hop above it (folded-runs' sendFoldedMail,
chat's WorkbenchMail.sendMail/platform-adapter/workbench-service/
turn-queue). A block response is simply a new message that replies to
the question card; the chat block-response route already sent it as a
plain message with no gate resolution to remove.

Bumps @corbits/interaction-tools to 0.0.7 and its pin in
workflows/assistant.
docs/CHAT.md now describes ask_user's post-and-end-turn shape (CL-7443)
instead of the retired message_response gate/correlation-id mechanism.
…443)

A checkpoint fixture with a retired message_response pending operation
alongside a valid approval one should restore with only the approval
op surviving, not throw.
A warm agent's persisted checkpoint/WAL can still carry a pending
operation with a signal kind this build no longer classifies (e.g. a
message_response op written before CL-7443 retired that kind). Left
alone, the reactor's rehydrateGates throws "Unclassified signal kind"
on every respawn, permanently wedging the agent.

Parse metadata.pendingOperations on restore and drop any op whose kind
is not a current SignalKind, reporting each drop through reportError
(operation: pending_op_dropped_unknown_kind) instead of letting it
reach the reactor.
reactor.ts still carried the retired message_response resume branch
(resumePendingOperation/timeoutMessageFor) and its own SignalKind
import, even though CL-7443's docs/ledger already claimed the package
was back to zero local delta. Replace it byte-for-byte with upstream
a8bc06ae's packages/inference/src/reactor.ts and update the recorded
kill-dates tree hash to match.
Asserts the tool result text explicitly tells the model to stop
(end this turn now / do not wait for a reply here), and exercises the
existing no-own-channel failure path that the next commit routes
through reportError.
Replace the report-error-ignore on the postQuestion catch with a real
reportError(err, { operation: "ask_user_post_question", agentId }) call
before returning the error result to the model, so a failed post is a
visible incident with a refId, not just a swallowed retry signal. Adds
@corbits/error-sink as a dependency and regenerates the tsconfig
project references.
…ng ops (CL-7443)

Note that the tool result's "end this turn" instruction is plain text
in the model's context, not something the runtime enforces, and that a
warm agent's in-flight question at deploy time is silently dropped on
restore rather than resolved -- the person's eventual answer just
becomes an ordinary next turn.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7443-ask-user-ends-turn branch from d9a7b32 to 5cc8036 Compare September 5, 2026 01:38
@TheGreatAxios
TheGreatAxios merged commit 2e70e72 into main Sep 5, 2026
7 checks passed
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