Skip to content

Keep a Planner's turn, questions and AI launch through renewals - #1001

Merged
lavaman131 merged 3 commits into
mainfrom
planner-launch-renewal-grace
Nov 24, 2026
Merged

lavaman131 merged 3 commits into
mainfrom
planner-launch-renewal-grace

Conversation

@lavaman131

@lavaman131 lavaman131 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

A remote Planner's turn was bound to its owner's GitHub credential. When that credential expired and was renewed (every few hours) the turn was aborted: the reply failed with "Couldn't finish the reply." and every question it was waiting on was withdrawn from Decisions. A machine's documents all share one credential, so every waiting document lost its questions at the same moment.

  • A running turn on a remote session now takes the renewed credential and goes on (ownerSignal in chat/service.ts). It stops, as before, when the owner signs out or the credential can't be renewed, and on a harness that can't rebind.
  • A retained session whose client is connected takes the renewed credential at once, so its open questions stay open. Before, only a suspended one did.
  • A session whose turn failed is now kept while it still holds an open question, so a failing reply no longer withdraws its Decisions; it is let go once its questions settle. A credential renewed just as a turn ends is taken by the kept session too, and a turn on a kept session follows that session's rebind, so the session holds one binding.
  • A session's AI launch replaced by a renewal now stays live for two minutes (REPLACED_LAUNCH_GRACE_MS) before it ends, so requests the client sent on it before it read the new grants aren't refused as ended. It still ends at once when the session does.

Verification

  • a question an attached Planner asked stays open in Decisions when its turn fails, and its answer reaches the client fails on main (the question is cancelled) and passes here; a failed foreground turn aborts late work and keeps a Planner that waits on a question until it settles replaces the test that asserted the old release.

  • New tests reproduce the bug: a question an attached Planner asks while its turn runs keeps the turn going through its owner's credential renewals fails on main (the question is cancelled) and passes here. holds a launch a renewal replaced until its grace ends, then ends it.

  • Updated the two tests that asserted the old behavior (a connected Planner's question ended at its credential's expiry; a returned client's replaced launch ended at once).

  • bun test src/chat src/harness src/agent src/questions (2465 tests; the one failure before the handover test update is now fixed), bun run types, dprint check and oxlint on the changed files.

A session's launch was ended the moment its renewal was sent, so a request the client
sent on it before reading the new grants, or was still streaming, was refused as ended
and failed the turn. The replaced launch now stays held and live for two minutes, and
ends at once when the session does.
…newal

A running turn was bound to its owner's GitHub credential and aborted when that credential
expired and was renewed, every few hours: the reply failed with "Couldn't finish the reply."
and every question it waited on was withdrawn. A remote session now takes the renewed
credential and its turn goes on; a retained session whose client is connected does the same,
so its open questions stay open. Only an owner who signs out, or a credential that can't be
renewed, ends them.
… is renewed as it ends

A question the Planner asked was still withdrawn when its turn failed: the failed turn destroyed
the session that held it, so the reply's error took every open Decision with it. A credential
renewed between the turn's last message and its close did the same, since the session's binding
had already ended. A session that still owes an answer is now kept whether its turn finished or
failed, and takes a renewed credential while it is kept. A turn on a kept session follows the
kept session's own rebind, so the session holds one binding at a time.
@lavaman131
lavaman131 merged commit 643fcc0 into main Nov 24, 2026
26 checks passed
@lavaman131
lavaman131 deleted the planner-launch-renewal-grace branch November 24, 2026 04:30
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