Skip to content

app: a suggested choice's clock runs only once a surface has drawn its card - #2155

Merged
santoshkumarradha merged 7 commits into
app/v3from
fix/choice-clock-after-drawn
Nov 3, 2026
Merged

santoshkumarradha merged 7 commits into
app/v3from
fix/choice-clock-after-drawn

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

What changes

A suggested choice's clock now runs only after a surface has drawn the card and its countdown.

  • The desktop app launches every agent with a choice clock (proposed_task_clock_s, 12 s by default). Before this change, the clock started when the question was raised.
  • A question that no surface had drawn, for example one from an agent that the person never opened, got the suggested answer 12 s later (decidedBy: "dial"). This happened even when the question blocked the turn.

Now:

  • tools_ask: a choice on the surface's clock is raised with no clock (no clock_until), blocking or not, and with no time limit. A choice that no surface has drawn never picks an answer by itself.
  • asks.shown (StartQuestionClock) starts the clock for its full length from that moment.
  • A clock that asks.shown changes is announced to every window with ask.opened. Before, the reply updated only the caller, and the lane's own restate was dropped as a duplicate.
  • Hello announces asks.clock.drawn, so a surface knows to send asks.shown when the card is on screen.
  • A project's own autonomy row for choices is the person's own setting and still runs from the raise.

The desktop side (the decision dock sends asks.shown once the card is visible and painted, only to an engine that announces asks.clock.drawn) is on the desk branch feat/asks-shown.

Tests

  • internal/session/tools_ask_drawn_test.go (new, written to fail before the change):
    • A choice that no surface drew carries no clock, and nothing picks it, even after the clock length has passed. After asks.shown, the clock gets its full length and picks the suggested answer.
    • A blocking choice that no surface drew never picks an answer by itself.
  • internal/appwire/askdrawn_test.go: an engine that has asks.shown announces asks.clock.drawn; an older engine does not.
  • cmd/codeaf/appquestionhold_test.go: now draws the card first, and checks that the clock it starts reaches the events.

Validation

  • gofmt and vet are clean. appwire and remote pass.
  • Touched packages, compared with the app/v3 base:
    • internal/session: 9 tests fail with the same names on app/v3 itself.
    • internal/taxonomy: fails on app/v3 too.
    • cmd/codeaf: four tests fail the same way on app/v3 when both trees run the same engine binary (R2, R3, both C1).
    • cmd/codeaf: TestAppTakeInstallFailureS5 is flaky on app/v3 (3 of 6 runs fail).
    • This change adds no new failures.
  • make changelog-check already reports 255 entries on app/v3 (mostly pr missing). This PR's entry carries its PR number.

Live check

The desktop app (with the dock change that sends asks.shown) ran on this engine build (rev d6b0e1d, hello lists asks.clock.drawn). All 26 model calls used OpenRouter deepseek/deepseek-v4.1-flash. Total spend was $0.03.

  • Not drawn: an agent raised a blocking choice with a suggested pick ("cat or dog", cat suggested) while its tab was in the background. ask.opened carried no clock_until. For 41 s nothing was sent, nothing was answered, and the ask stayed open as "1 needs you".
  • Drawn: the person switched to that tab at 05:14:35.55 UTC. The dock sent asks.shown. The engine re-announced the ask with clock_until 05:14:47.867, 12.3 s later, and the card counted down "Picks cat in 12s". At 05:14:47.869 the clock took the suggestion (ask.closed, option 1).
  • Drawn at once: a second agent whose card was on screen when it asked went straight from asks.shown to a 12 s clock, then the pick. Its own reply said: "No answer came before the clock ran out, so my suggested pick stood".

🤖 Generated with Claude Code

santoshkumarradha and others added 7 commits November 1, 2026 18:06
…the card

The desktop launches every agent with a 12 s ChoiceClockSeconds, and the clock
started at the raise: an errand whose card no surface drew had its suggested
answer taken 12 s later for a person who never saw the question (decidedBy
"dial"). Now a choice on the surface's clock is raised with no clock and waits
for asks.shown (StartQuestionClock), blocking or not, with no bound; a
project's own autonomy row still runs from the raise. The hello says so
(asks.clock.drawn), so a surface knows to send asks.shown once its card is on
screen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ShowAsk updated the ask it answered but emitted nothing, and the lane's own
restate then matched it and was dropped, so a second window (or the caller,
when it read events) could miss the countdown the engine was counting. A
changed clock now re-announces the ask once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@santoshkumarradha
santoshkumarradha marked this pull request as ready for review November 3, 2026 09:29
@santoshkumarradha
santoshkumarradha merged commit 79d83f9 into app/v3 Nov 3, 2026
@santoshkumarradha
santoshkumarradha deleted the fix/choice-clock-after-drawn branch November 3, 2026 09:29
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