Files
loki/scripts
CatoandClaude ec0cd635ba feat(inject): session "fresh" starts a one-off session in its own worktree and closes it when it reports (#1640)
* fix(inject): a message to a busy project waits its turn; only a caller that asks gets a parallel lane

With parallel dispatch on, every dispatch to a busy project forked a lane with
a new agent session. A message sent to orangecat while a run was open
(2026-11-12) started a second agent instead of queueing behind the open run,
while the same message to loki queued: the difference was whether a lane was
free, not what the caller meant.

- orchestration/busy-placement.ts: the one rule. Busy means queue, first in,
  first out; a lane only for whenBusy: "lane".
- executeInject plans a lane only through that rule.
- feedback Implement asks for a lane, as before. /api/inject, the MCP
  loki_dispatch and chat dispatches are messages to the session and queue.
- scripts/test/busy-placement.ts pins the rule and those callers.

* feat(inject): session "fresh" starts a one-off session in its own worktree and closes it when it reports

A read-only one-off question typed into a project's shared session does not
stay one-off: "only run git status, then stop" was answered, and then the
session went back to its own plan and edited tests (2026-11-12).

- POST /api/inject and the MCP loki_dispatch take session: "fresh".
- The prompt gets a lane of its own whether or not the project is busy: a new
  agent in its own worktree, no resumed conversation, told it is a one-off.
- When it reports ready the run closes and close_tab is queued for the lane.
- It never falls back to the shared tab: without a lane it is refused with
  fresh-session-unavailable (409) and nothing is sent.
- scripts/test/busy-placement.ts pins the rule, the prompt, the close and the
  two entry points.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 06:33:10 +01:00
..
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00