Skip to content

Pull request cards say why gh or glab could not answer - #3093

Draft
backnotprop wants to merge 26 commits into
mainfrom
feat/inbox-tool-states
Draft

backnotprop wants to merge 26 commits into
mainfrom
feat/inbox-tool-states

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

When the Inbox asks gh or glab for pull or merge request data and cannot get it, the card now says which of six states it is. Each state has one short title, at most one short line, and one next step. Before, the best it could say was "The Inbox did not answer. Try again in a moment."

The words

State Title Line Next step
Missing gh isn't installed Install the GitHub CLI, then try again. Install gh (link), Try again
Signed out gh isn't signed in to github.com Run this once in a terminal, then try again. gh auth login --hostname github.com with Copy, Try again
Signed out (a token in the environment) gh isn't signed in to github.com GitHub refused the token in GH_TOKEN. Replace it, or remove it and sign in. Try again
Timed out gh didn't answer in 8 seconds It may be slow or stuck. Try again in a moment. Try again
Refused gh can't see this pull request No signed-in GitHub account can see it, or it doesn't exist. (glab: Your GitLab account on <host> can't see it, or it doesn't exist.) Open on GitHub
Rate limited GitHub asked for a short break Try again in a minute. none
Failed gh couldn't read this pull request If it keeps failing, check that gh works in a terminal. Try again

glab uses the same words, with GitLab, glab and "merge request".

A host the person does not already use never gets a command or a "signed in" claim. It gets the hover card's plain line instead: "Details show for hosts your gh is signed in to. This one isn't, so nothing was fetched." The card still offers Try again.

Which hosts a command may name

There is one rule (commandHostTrusted in @plannotator/core/problem-words), and every surface uses it. A command can name only:

  • the exact github.com or gitlab.com;
  • a host in the CLI's own configuration, in any state;
  • the project's own origin host.

Any other host gets no command: a look-alike like github.corn or gitlab-acme.com, or any host that only an agent's link named. gh auth login --hostname <look-alike> would send the person's sign-in to whoever runs that host. A link whose host only starts like a public forge (gitlab.com.evil.example) is not read as a forge link at all.

What changed

  • How the state is found. The tool's run decides first. When the run is vague, a cached auth status --hostname check decides; it has its own 3 s deadline.
  • Hosts the CLI is not signed in to. Nothing runs there:
    • Not installed says "missing", on a self-managed host too.
    • A host in the CLI's configuration gets the status check. When the check cannot tell, the card says failed or timed out, never signed out.
    • The check runs only behind the window's read, so a hover never waits on it.
  • Try again. It is offered after the action for missing and signed out. The route's ?retry=1 reads the CLI's hosts and the status check again, so the card recovers right after a sign-in.
  • Status codes. They are read only in the tool's own shape ("HTTP 429", "429 Too Many Requests", "(429)"). A PR numbered 429 or a project named svc-401 is not a rate limit or a sign-in problem.
  • What reaches the browser. The answer carries a small problem (code, title, line, action, retry). The tool's own output stays on the server. Older windows keep reading error.
  • Shared words. The thread's card, the link hover cards and the Pull requests page all use the same words. When no answer came at all, a hover card says "Details couldn't load right now." Bitbucket cards keep their own lines (Bitbucket has no CLI).
  • Both runtimes. The Bun and Pi servers serve the link hover endpoints through shared code.
  • Package. @plannotator/core 0.25.32 adds ./problem and ./problem-words. ui pins it; see packages/ui/HANDOFF.md.
  • Size ceiling. In tests/inbox-size-ceilings.json, packages/inbox/api.ts goes down to 2375 lines.

"Ask your agent to look" is no longer in this PR. It is kept on the branch feat/inbox-ask-agent-to-look, which has no PR.

Checked

  • Unit tests:
    • problem-words: next steps, which hosts a command may name, look-alikes.
    • tool-state: 429 and svc-401 negatives, forget, what a CLI says about its hosts.
    • inbox-thread-pulls-route:
      • a GitHub Enterprise host that is signed out, then recovers after Try again;
      • a configured host that cannot be checked;
      • missing on self-managed hosts;
      • the project's own GitLab host compared with look-alikes, where no tool runs.
    • Also: ref-cards-node, forge-host-trust, inbox-pull-lookups, ref-cards-bitbucket, pulls/model, inbox-structure, vendor-parity.
  • DOM tests: ThreadPulls (Try again on signed out; no command for an unknown host), RefHoverCard, App.refCards.
  • Typecheck: core, shared, server, ui (including the strict consumer), inbox, Pi and the Inbox app.
  • Real gh: checked earlier for signed out, a bad token, no login for a host, and missing. glab is simulated with fake scripts.

e2e: inbox-pull-marker-hang.spec.ts

…hared words

Six states (missing, signed out, timed out, refused, rate limited, failed),
read from the run and, where the run is vague, from a cached status check
with its own deadline. A thread's PRs and the hover cards carry the problem
beside the older error code; the tool's own words stay on the server.

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
An icon, the bold line, the muted line, and Copy for the sign-in command or
Try again, under what the Inbox knows. Link hover cards and the Pull
requests page use the same words.

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
The list can draw a line above the rows (the notifications banner) while a
card is open; the row slid from under the resting pointer, the browser sent
a leave the person never made, and the card closed. Now a move off the mark
and the card, or out of the window, closes it; the read is still cancelled
when it does.

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
A self-hosted merge request showed its full URL as its title and in
"Remove … from this thread". Now group/project!45, with the host in front
only off github.com and gitlab.com (forgePullRefShort, beside
forgePullRefText, which stays what agents write back).

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
It had a fixed height and no wrapping, so a long name ran out of the sheet.

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
smoke:package: the core source manifest gained ./problem and
./problem-words, which the published core 0.25.22 lacks. core is 0.25.24
(main took 0.25.23 for ./call-tree, #3086; this branch is stacked on #3082)
and ui pins it exactly; bun.lock changes only the two core version lines (set
by hand), and HANDOFF's Publishing & versioning lists it. When this branch
meets main, core takes the higher version and keeps every subpath. Publish
core first.

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
On CI's Linux, /usr/bin holds a real gh, so the "not installed" case found
and ran it (Bun read a timeout, Node a sign-in). The fake folder alone is on
PATH now: the fakes need nothing else.

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
Core stays 0.25.24 here, on top of main's 0.25.23 (the Call tree).

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
@backnotprop
backnotprop changed the base branch from fix/pull-marker-hover-hang to main November 11, 2026 16:05
A quiet action after each tool state's own next step, on the PR card, the
Pull requests page and link hover cards. One press opens New message
filled in (openComposer): To the thread's agent, "Look into: <the line>",
and a body that is the redacted report plus the ask, ending with a once,
yes-only offer to send an anonymous report with `plannotator feedback`.

- core/problem-report.ts: problemReport and redactReportText (tested).
- server/inbox-problem-facts.ts: an in-memory log of failed forge runs
  (redacted as kept) and GET /api/inbox/problem-facts.
- ui: ProblemNotice `extra` and the refCardProblemExtra seam (additive).

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv

# Conflicts:
#	packages/inbox/threadPulls/ThreadPulls.tsx
…un it came from

The tool log took every host out as a run was kept, so a run that named no
--hostname showed the forge's own host as <host> while another kept it. Now
tokens, emails and the home path go as it is kept, and every other host when
it is read for the report. Tested.

Claude-Session: https://claude.ai/code/session_01VJ6b1oES3jfkCyDmf8uKzv
Comment thread packages/core/problem-report.test.ts Outdated
"Authorization: Bearer abc.def.ghi-123456",
"Cookie: _gitlab_session=abcdef123456",
"GITLAB_TOKEN=supersecretvalue1 glab api",
"token eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0In0.c2lnbmF0dXJl",
# Conflicts:
#	apps/pi-extension/vendor.sh
#	docs/agent-guides/guides-and-shared-ui.md
#	docs/agent-guides/inbox-notifications-and-agents.md
#	docs/agent-guides/server-and-storage.md
#	packages/core/forge-ref-card.ts
#	packages/core/package.json
#	packages/inbox/App.tsx
#	packages/inbox/api.ts
#	packages/inbox/threadPulls/ThreadPulls.test.tsx
#	packages/inbox/threadPulls/ThreadPulls.tsx
#	packages/server/inbox-thread-pulls-route.test.ts
#	packages/server/inbox-thread-pulls.ts
#	packages/server/inbox.ts
#	packages/shared/ref-cards.ts
#	packages/ui/HANDOFF.md
#	packages/ui/components/RefHoverCard.tsx
#	packages/ui/configure.ts
#	packages/ui/package.json
…ver named in a command

- Each state is one short title, at most one short line, one next step.
- After the merge with main: a host gh or glab lists no login for is signed out at once, with no status check naming it.
- Bitbucket hover and PR cards keep their own lines; no gh or glab words on them.
- The command row is plain text with Copy, not a boxed well.
- The thread PRs reader and the facts query move out of api.ts (ceiling lowered to 2378).
…from inbox-test

The relay-pin and held-copy drift guards on main require both for an Inbox browser spec.
# Conflicts:
#	packages/core/forge-ref-card.ts
…in after signing in; no Ask your agent to look

- One rule (commandHostTrusted) for every surface: a sign-in command and "isn't signed in to <host>" name only github.com, gitlab.com, a host in the CLI's own configuration, or the project's own origin host. Any other host gets the plain line and no command.
- Not installed says missing on a self-managed host too. A configured host that cannot be checked reads failed or timed out, never signed out.
- missing and signed_out offer Try again; ?retry=1 reads the CLIs' hosts and the status check again, so the card recovers right after a sign-in.
- A PR numbered 429 or a project named svc-401 is not a rate limit or a sign-in problem.
- Removed Ask your agent to look (control, problem-facts route, report builder, spec, docs); kept on feat/inbox-ask-agent-to-look.

This branch has not been deployed

No deployments
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.

2 participants