Commit Graph
2 Commits
Author SHA1 Message Date
can1357 eeeab97db0 fix(session): auto-reply awaited IRC sends to an idle plan-mode session
Plan mode records idle IRC deliveries into context without waking a turn,
so an 'irc send await:true' sender was stranded until its wait timeout:
delivery reported injected but no reply could ever be generated. Extend the
existing ephemeral side-channel auto-reply (previously only for mid-turn
recipients with async execution disabled) to the idle plan-mode case — the
second situation where a real reply turn cannot happen in time. No primary
turn is woken; plan-mode convergence stays user-driven.

The deliverIrcMessage eligibility change itself rode in the previous commit
(same-file hunks); this commit carries the bus doc and the regression test:
an awaited idle IRC message in plan mode resolves the sender's bus waiter
via the side-channel reply while the primary loop stays asleep.
2026-07-02 10:30:51 +02:00
metaphorics 0d23cb75c2 fix(session): converge plan mode on ask/resolve across continuation paths
Plan-mode convergence (call `ask` or `resolve`) was enforced on only the
non-synthetic `prompt()` return. Every other turn-ending path — `agent.continue()`
drains, the IRC idle wake, and advisor steer delivery — settles via `agent_end`
and bypassed it, so advisor/IRC/follow-on traffic could keep the agent producing
non-converging turns indefinitely (the prompt() recovery wait never returns while
continuations run, and agent-core re-drains late steering/asides before agent_end).

Suppress non-user producers in plan mode: `#routeAdvice` preserves the advisor
card (visible + persisted, no turn) and the idle IRC paths (`deliverIrcMessage`,
`#resumeStrandedIrcAsides`) record into context without waking a turn. User
steers/follow-ups are untouched and still resume planning.

Enforce the decision at the universal `agent_end` terminal settle via a
bounded-retry counter: a plan-mode turn that stops without `ask`/`resolve` gets
the reminder plus a provider-neutral `required` choice (both tools stay
available), up to a fixed cap, then yields to the user. A non-decision tool
answer (e.g. `read`) does not reset the cap, so it cannot loop or silently end
plan mode un-converged; `ask`/`resolve`, a fresh user prompt, or plan-mode exit
reset the counter. Todo-completion reminders are gated off in plan mode so they
cannot re-wake a turn the cap intends to yield. Removes the now-redundant
post-`prompt()` enforcement to keep a single policy.

Op: correct
Restores: spec:plan-mode turns must converge to ask/resolve or yield after bounded reminders
2026-07-01 00:24:11 +09:00