Skip to content

fix(j5): an agent's question shows once in the Inbox after a server restart - #1018

Merged
Jacksondr5 merged 1 commit into
j5/mainfrom
j5code/inbox-question-per-thread-1010
Nov 11, 2026
Merged

Jacksondr5 merged 1 commit into
j5/mainfrom
j5code/inbox-question-per-thread-1010

Conversation

@Jacksondr5

Copy link
Copy Markdown
Owner

Problem

After a test server restarted, Jackson's Inbox showed the same agent's question twice: the old row ("Asked a question while continuing its work") and the new one ("Waiting for an answer to continue"). Answering one removed both. Part of #1010 (item 3).

Cause

Two upstream behaviours combine, and J5's read listed the result as it stood. J5 stores no stale link of its own; it reads the thread's pending requests live.

  1. On restart, upstream's ProviderRuntimeRecoveryService keeps an unanswered question pending but switches it to responseCapability: "message", so it can still be answered by message or dismissed.
  2. Upstream's restart continuation resumes the interrupted turn, and the agent asks again as a new live request.

The thread then holds two pending questions. Upstream's composer shows them one at a time (pendingUserInputs[0]). J5's nativeQuestionInboxRead listed every pending question, so the Inbox showed both, and the bell counted both. Upstream keeps the old question on purpose, so this isn't an upstream bug.

What changed

The Inbox lists one "Agent questions" row per thread:

  • the row is only a link to the thread, where the question is answered one at a time;
  • it takes the question the agent is waiting on if there is one (live), and otherwise the newest;
  • the bell counts one per thread.

It's done on the server in nativeQuestionInboxRead.ts, so web and mobile both get it.

Tests: a new case in nativeQuestionInboxRead.test.ts lists a thread with a message question and a later live one as one live row. It failed on trunk with two rows.

Live testing

Pending, from the crew tester: restart a test server while a real Haiku agent waits on its provider's question, and check for one row after the turn resumes.

Checklist

  • One concern: one question row per thread
  • Tests: written first, failing on trunk
  • UI changes: no layout change; the tester will capture the restart case
  • Live testing: the section above says it is pending
  • Upstream-owned files: none edited
  • Upstream product: no change
  • Surfaces: the server read feeds the Inbox and bell on web, desktop and mobile. No contract change: the item keeps its shape.
  • Docs: a sentence for the Inbox definition goes in the wave's docs PR

Built by Claude Opus 5.5 in Claude Code (J5 crew seat builder-identity).

🤖 Generated with Claude Code

…estart

A restart leaves an unanswered question answerable by message, and the resumed
turn asks it again, so the thread holds two pending questions and the Inbox
listed both. The Inbox now lists one question row per thread, the one the
agent is waiting on if any, since the row only links to the thread, which
shows one question at a time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 11, 2026 10:15pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 53 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 51 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bed54fa and 122e10a.

Files selected for processing: 2

  • apps/server/src/j5/a2a/nativeQuestionInboxRead.test.ts
  • apps/server/src/j5/a2a/nativeQuestionInboxRead.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review: reviewer-opus and reviewer-sol (Claude Opus 5.5 and GPT Sol 6.1), head 122e10a

Both of us reviewed the PR independently. Neither found anything that blocks merge.

  • The policy. nativeQuestionInboxRead lists one row per thread. It takes questions.findLast(live) ?? questions.at(-1) over the pending user_input requests that can be answered live or by message.
  • Order. "Last" is the newest: the projection loads runtime requests ORDER BY created_at ASC, runtime_request_id ASC (ProjectionStore.ts).
  • Filters. Per-thread scoping and the pending, kind and capability filters are kept. The Captain, Crew-seat and archived exclusions are unchanged.
  • Test. The new test (a message question, then a live re-ask, gives one live row) failed on trunk. 25 nativeQuestionInboxRead tests pass. The bell's count drops by the duplicate, which is correct.

Code approval: the panel has no open code findings. Still pending: green J5 CI.

@github-actions github-actions Bot added size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list. labels Nov 11, 2026
@Jacksondr5
Jacksondr5 merged commit fa66f69 into j5/main Nov 11, 2026
31 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/inbox-question-per-thread-1010 branch November 11, 2026 22:38

This branch was successfully deployed

1 active deployment
Preview — 122e10ab Deployed Nov 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant