Skip to content

Close cancelled Claude question forms - #4697

Closed
ymichael wants to merge 4 commits into
mainfrom
bb/i-feel-like-i-answer-some-ask-user-questions-too-thr_dby5vca3mk
Closed

ymichael wants to merge 4 commits into
mainfrom
bb/i-feel-like-i-answer-some-ask-user-questions-too-thr_dby5vca3mk

Conversation

@ymichael

@ymichael ymichael commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

When Claude cancelled a native question or permission request, its bridge removed the local waiter without notifying BB. Interactive requests also were not registered with the runtime's cancellation tracker. BB could therefore keep showing an answer form after Claude stopped waiting for it.

What changed

Forward Claude cancellation as notifications/cancelled, track interactive requests with an abort signal, and carry cancellation through the host daemon to the server. Interrupt only the matching provider request so a delayed cancellation cannot close a newer question. Handle cancellation before, during, or after registration. The existing interaction update removes the active form.

HOST_DAEMON_PROTOCOL_VERSION increases 226 → 227 for the request-ID field on the interrupt endpoint. Plugin SDK 0.6.14 → 0.6.15 exposes the existing cancellation-method constant, documented in the Plugin Guide and authoring index. No database migration or new user-facing commands.

How you verified

  • 164 focused tests passed through Turbo: Claude bridge (80), daemon registry (8), runtime interactions (14), internal server interaction routes (13), and daemon contract (49).
  • Cancellation regressions fail against their pre-fix owners: missing bridge notification, unresolved daemon waits, missing runtime abort signal, and cancellation affecting an unrelated request. They pass with the fix restored.
  • Relevant Turbo lint and typechecks passed for the daemon, server, runtime, database, daemon contract, Plugin SDK, Claude plugin, and Plugin Guide plugin.
  • Recorded Claude user-question parity replay against base 7e1392894a: passed, no event/row differences or grammar drops.
  • Rebuilt and reran live Chromium validation with real Claude on 144578f73c: normal native answer, browser Cancel, persisted provider-cancellation reason and closed form after reload, stale answer HTTP 409, subsequent native answer, completed duplicate reply, and full server/daemon restart without replay. Supplemental current-registry checks pass for submit-first/cancel-first ordering.
  • Live evidence and current CI are in the thread handoff. Autonomous Claude timeout was attempted with real unanswered questions on Claude 2.1.286 / SDK 0.3.245: default 114s, question timeout 60s observed 198s, and question plus dialog expiry 60s observed 340s all remained pending. The effective timeout settings were confirmed by the SDK resolver; no cancellation was injected. An explicit instruction to give up after 30s also remained pending at 94s; Claude explained it could not interrupt the blocking question. Normal cleanup answers reached Claude and were acknowledged. These are failed reproductions, not timeout regression passes. Live transport-loss timing was not reproduced; permission cancellation has no new live coverage. This does not claim the historical incident reproduces current main.

AGENT GENERATED

@ymichael ymichael changed the title Preserve undelivered Claude answers Close cancelled Claude question forms Oct 2, 2026
@ymichael ymichael closed this Oct 2, 2026
ymichael added a commit that referenced this pull request Oct 5, 2026
## Human comments

## What was wrong

Partial question answers lived only in the mounted React form. Switching
to another thread or reloading the page reset selections, free text, and
the current question before the user submitted them.

## What changed

Persist drafts for native provider questions and the real Ask User
Question plugin by thread and interaction identity. Restore partial
selections, exact free text, and question position; validate saved
values and ignore changed question definitions. Retain drafts on failed
submit/cancel and clear them after success, without erasing answers
edited while an older submission was pending. Browser storage failures
fall back to memory for navigation.

Drafts are browser/device-local with no cross-device synchronization or
time expiry. Server pending state controls whether a form can appear:
resolving an interaction elsewhere can leave inert local data until site
data is cleared. Only these two question forms opt in; secret-request
forms do not persist drafts. Older clients ignore the new namespace. No
database migration, public SDK/CLI surface, or daemon protocol change.
Documented in `docs/debugging-and-qa.md`.

## How you verified

- Regression fails on the original shared form: navigation loses the
second-question position and draft answers.
- Turbo: 34 focused app tests and 35 Ask User Question plugin tests
pass; app/shared-ui/plugin typechecks and lint pass.
- Final-head real Claude native questions and real Codex Ask User
Question plugin forms: matched base/head multi-question navigation and
reload; selected options, exact Notes free text, and question 2 of 3
survive. New interactions start empty even with inert older local
drafts. Successful submit and cancel clear storage; resolved/canceled
forms stay closed after reload. Both providers acknowledge submitted
answers.
- Supplemental injected HTTP 503 submit/cancel failures retain both
forms and drafts through reload. Storage-full/corruption/identity
isolation are covered by focused tests.
- Regenerated the published component registry and verified its
tests/typecheck plus all fork checks in CI.
- Final-head CI: 31 passed, three skipped, no failed or pending checks.
Persistent clean-head `pnpm start:worktree` review fixture:
https://ymichael--23106.getbb.app/projects/proj_rbdqqa8ssj/threads/thr_bebmcxdkui.
Handoff: `/Users/michael/.bb/thread-storage/thr_u497kinnh5/HANDOFF.md`.
- Overlap checked: #4044 is merged and rejects secret Codex inputs;
#4697 is closed/unmerged and addresses provider cancellation, without
overlapping form/storage code. Neither branch changed.

> AGENT GENERATED
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