Repository navigation
ref(capabilities): Move jr-rpc to bash custom command path - #3
Merged
Merged
Conversation
dcramer
marked this pull request as ready for review
February 27, 2026 02:05
…class jrRpc tool Replace the shell tokenizer and flag parser with a structured tool definition that accepts typed inputs (action, capability, repo, command, format). This eliminates fragile shell parsing, enables richer tool status reporting, and allows the sandbox to inject credentials via network-layer header transforms instead of only env vars. Key changes: - Add jrRpc tool definition with TypeBox schema - Replace parseJrRpcCommand with mapJrRpcToolInputToCommand - Add contextual error builders with actionable hints for common crypto and config failures - Support headerTransforms in sandbox bash executor for Authorization header injection via network policy - Remove sandbox jr-rpc stub binary and chmod setup - Update all skill docs and references to new tool syntax Co-Authored-By: Claude <[email protected]>
Route jr-rpc credential enablement through the sandbox bash custom-command flow and remove the remaining rpc/tool interception paths. Keep credential delivery header-only via sandbox network transforms and align skills/specs/tests with the new runtime contract. Co-Authored-By: Codex <[email protected]>
Return structured jr-rpc command errors when credential issuance fails so the\nagent receives stderr and exit codes instead of an unhandled exception.\n\nAllow the test credential broker to accept github.* capabilities so eval\nruntime requests are compatible with the test broker.\n\nAdd a regression test covering runtime issuance failure handling.\n\nCo-Authored-By: GPT-5 <[email protected]>
dcramer
force-pushed
the
ref/jr-rpc-to-tool
branch
from
February 27, 2026 02:43
c575f32 to
4cdc692
Compare
Prevent network policy restore errors in the bash executor finally block\nfrom masking the original command execution failure.\n\nAlso de-duplicate bash command parsing/validation in execute by deriving\nthe normalized command once and reusing it for custom command routing\nand normal execution.\n\nAdd a regression test that verifies command failures are preserved even\nwhen policy restoration fails.\n\nCo-Authored-By: GPT-5 <[email protected]>
Keep the header transform list in a local variable so TypeScript can\ncorrectly narrow before calling mergeNetworkPolicyWithHeaderTransforms.\n\nThis preserves the previous behavior while fixing the Vercel typecheck\nfailure introduced in the prior sandbox refactor.\n\nCo-Authored-By: GPT-5 <[email protected]>
Issue repository-scoped GitHub installation tokens when a capability\ntarget includes a repository, and keep installation-wide behavior only\nwhen no target is provided.\n\nScope broker token cache entries by target so tokens are not reused\nacross repositories.\n\nAdd tests for scoped token request payloads and cache isolation by\nrepository target.\n\nCo-Authored-By: GPT-5 <[email protected]>
Allow jr-rpc credential issuance to accept optional repository scope and\npass repoRef through enableCapabilityForTurn into lease issuance.\n\nAlign eval smoke skill with github.* capabilities and exercise actual\ncredential enablement through jr-rpc instead of a no-op echo command.\n\nUpdate jr-rpc docs/prompt guidance and add regression tests for --repo\nparsing and runtime repoRef forwarding.\n\nCo-Authored-By: GPT-5 <[email protected]>
Reject github capability enablement when repository context is missing,\nforcing jr-rpc credential issuance to stay repository-scoped.\n\nKeep explicit repoRef support and invocation-arg target discovery, and\nadd regression coverage for missing-repo and forwarding behavior.\n\nCo-Authored-By: GPT-5 <[email protected]>
Only emit credential injection start/cleanup logs for bash commands\nthat run through sandbox network policy injection.\n\nSuppress these logs for jr-rpc custom commands, which are handled\noutside sandbox execution and do not apply header transforms.\n\nCo-Authored-By: GPT-5 <[email protected]>
Prevent turn-level credential cache reuse across different repositories by\nincluding repository scope in the runtime cache key.\n\nAdd regression coverage showing repeated capability enablement for two\nrepos issues separate leases instead of reusing the first token.\n\nCo-Authored-By: GPT-5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Run the eval smoke command as a direct jr-rpc invocation so the custom\nhandler path is actually exercised instead of executing through bash -lc.\n\nRemove the unreachable args-length validation branch in the jr-rpc\ncommand parser to eliminate dead code without changing behavior. Co-Authored-By: GPT-5 <[email protected]>
MathurAditya724
added a commit
that referenced
this pull request
Oct 30, 2026
…#2418) Improves how event details and the subagent event log look in the dashboard. **Event details header** - In UTC mode, the timestamp now reads like local mode (`Aug 7, 2026, 11:54:09 UTC`) instead of a raw ISO string. It shows whole seconds in the sans face and stays on one line beside the actions, so it no longer wraps. The tooltip shows milliseconds, and the ISO value stays in the `datetime` attribute. Raw JSON is unchanged. - The header shows the event's sequence number (`#3 · …`). It matches the `?event=` link parameter and the row label. - The previous and next buttons now sit beside the close button. Before, they came right after the event name, so they moved whenever the name length changed, which made stepping through events awkward. This layout is shared, so other docked panels place their actions the same way. The drawer and the mobile sheet already did this. - The previous and next buttons are now one bordered shadcn `ui/button-group` named "Event navigation", so they read as one control apart from close. `ui/button-group` and `ui/separator` came from `shadcn add button-group`, trimmed to the parts we use, with dashboard tokens and radius. **Event details body** - Fields are grouped in the same card that Conversation details use (`DetailsCard`, moved into `DetailsList`). Groups inside a card, such as tool input and output, use a divider instead of a nested card. **Subagent drawer event log** - The drawer body no longer has an inset in Event log view, matching the main Conversation page. Rows now reach the drawer edges. The sticky search and column header now sit flush at the top, so rows no longer show through a gap above them while scrolling. **Nested drawers** - `Drawer` now uses the shadcn Base UI drawer (`ui/drawer`, added with `shadcn add drawer` and trimmed to the parts we use) instead of `ui/sheet`. When event details open from inside the subagent drawer, they stack in front of it, like the shadcn nested drawer example. The parent scales back, shows a thin edge, and hides its content. The overlay, focus trap, scroll lock, and Escape behavior stay the same. `BottomSheet` and the mobile nav still use `ui/sheet`. - `useSheet`'s `onOpenChange` reads only `details.cancel()`, so Dialog and Drawer roots can both use it. Swipe-to-dismiss to the right now works on these drawers, because the Base UI drawer supports it. Mouse text selection inside the content still works. <!-- junior-request-attribution:start --> via **Aditya Mathur**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3A876aa134b9d63766e841e3cb --> -- [View Session in Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A876aa134b9d63766e841e3cb/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: adm <[email protected]>
BYK
added a commit
that referenced
this pull request
Nov 10, 2026
When Junior asks a question (an open action Review item that waits on
the viewer), the question now docks directly above the message box.
Before, a full card appeared in the transcript at the tool-call
position, above Junior's final message, and the message box and queued
messages were hidden until the reader answered or dismissed it.
## What changes
**Docked question** (`review-desk/ComposerQuestion.tsx`)
- Shows every open question in the Conversation that the viewer can
answer, oldest first. When more than one is open, the header shows "1 of
N" with previous and next buttons.
- Header: title and Dismiss. Esc dismisses when focus is in the question
and not in a text field.
- Single choice questions show their choices as buttons with number
hints. Keys 1–9 pick one. The hints use `aria-keyshortcuts`.
- `multi_choice` and `text` fields stay inline. The docked form has no
note field ("Anything else?"), no Other…, and no Send of its own: the
message box is the one place to write and send. Its placeholder changes
to "Or type your answer…".
- When the question has focus, typing a printable key moves focus to the
message box, so the key starts the answer there.
- After an answer, the next question takes focus. When none are left,
the message box does.
- A palette or list switch into a waiting Conversation focuses the
question on desktop, so number keys work at once. On touch screens
nothing takes focus, as before.
- On mobile, the question sits in the `ComposerDock` `above` slot. It
rides the keyboard with the message box and scrolls inside the dock when
it is tall.
**Message box**
- The hide-composer logic is gone from `ConversationReplyFooter`: the
`reviewItemId` prop, `composerShownForItemId`, focus tracking, and the
hidden wrappers. The message box and queued messages always show.
- A typed message still answers through the existing server path:
`api/conversations/create.ts` → `closeReviewItemsAnsweredByReply`. That
path matches the reply to open questions with the decision model and
closes the matches with the reply as `other`. Coverage for it already
exists in `tests/integration/slack/review-item-card-webhook.test.ts`
(dashboard post) and in the `review-item-replies` classifier eval. This
PR does not change that path.
- **One Send.** Send in the message box first sends the picks of every
docked question that has them, then the typed message. The server
matches that message to the questions still open. A reader can pick
answers for some questions and type the answer for another in one send.
Send is enabled when only picks wait. If an answer fails, the draft and
the picks stay so the reader can retry.
- The "Send without your answers?" confirm now applies only to picks in
the details panel, because those do not go with a message.
- Respond (selection quote) uses the same `appendText` handle. The box
is always visible now, so the quote always lands.
**Transcript**
- The full `ReviewItemCard` at the tool-call position is replaced by a
one-line record: "Asked *title*", then "Waiting on you", the one-line
answer, or "Dismissed". The title links to the review desk. If the
viewer cannot read the item, the raw tool frame shows as before.
- `transcriptListRows` moves each ask to the end of its Turn, after the
final message, so the reader sees why before what. The moved row takes
the seq of the row before it, so row order stays monotonic for
`rowIndexForSeq` and the New marker. Activity on both sides of an ask
stays one group.
- `TranscriptReviewItemCard` and the pin-start scroll mechanism in
`transcriptBottomPinning.ts` are deleted. The card was their only
consumer.
- The review desk and the details panel still use `ReviewItemCard` and
`ReviewItemActions` unchanged. The Inbox page and the app shell are not
touched.
**Mock mode**
- `mock-reporting/review-items.ts` serves Review items from
process-local state. It has two new Conversations:
- **Roll out payments-v42**: one open choice question, plus an earlier
question that was answered by a typed reply.
- **Plan the billing migration**: three open questions (described
choices, multi_choice plus text, plain choice).
- Actions change the state. A mock send closes the oldest open question
in its Conversation, as a stand-in for the decision model.
- The e2e harness resets this state.
## Review follow-up: one Send
@BYK pointed out that the docked form and the message box both send to
the agent. The form's "Anything else?" note and the message box were
redundant, and a reader could not type an answer and also answer some of
the questions. The docked form now has no note and no Send. The message
box sends the picks first, then the typed words. The stepper and the
placeholder are unchanged.

The details panel form keeps its own note and Send. Its picks still ask
before a message drops them:

## Scroll to context
The docked question now shows where Junior asked it. A step with
Previous or Next, an answer that moves to the next question, or a click
on the question title scrolls the transcript so that question's "Asked
…" record sits in the middle. The record gets a short violet ring, the
same ring style that `ConversationReviewItems` uses.
- A question that docks by itself during a live Turn moves the
transcript only while it follows the latest, and then only far enough to
show the record. A reader who scrolled up stays where they are.
- Opening a Conversation keeps today's start: the latest message or the
"New" marker.
- With `prefers-reduced-motion`, the transcript jumps instead of a
smooth scroll. Only the transcript scrolls, never the page. This is
checked on desktop and on mobile.
- The scroll goes through the bottom-pinning owner (`showRow` in
`transcriptBottomPinning.ts`). It updates the saved place, so a dock
resize does not pull the reader back.
- A record outside the loaded rows opens the page around its Turn, as a
Turn link does (`openLink`). There is no new paging path. While a search
hides the record, or in the event log, nothing scrolls. A question added
from a child Conversation has no record here, so it does not scroll
either.

<img alt="The same on mobile"
src="https://junior-prod.sentry.dev/public/artifacts/ebdf64f3-29f3-4266-9405-b7a5e1121b0b.png"
width="320">
## A page of questions that fails to load
If a page of open questions fails to load, the footer says "Some
questions did not load." with Try again. Before this, the dock treated
the list as complete, so questions on that page and later ones never
docked.
| Desktop | Mobile |
| --- | --- |
| <img
src="https://junior-prod.sentry.dev/public/artifacts/ca739733-48f0-4f91-9975-19a84eebc4e4.png"
width="480" alt="Desktop: Some questions did not load, with Try again,
above the message box"> | <img
src="https://junior-prod.sentry.dev/public/artifacts/d5f8b65d-29d5-4d50-b499-39d3210ce121.png"
width="200" alt="Mobile: Some questions did not load, with Try again,
above the message box"> |
## Why
- **Mapping (Norman, *The Design of Everyday Things*).** The control
that answers a question should sit where the answer goes. The old card
answered in the transcript, but the message box, the one control people
use to talk to Junior, was hidden. Docking the question on the message
box puts every way to answer (click, key, or typed words) in one place.
- **Mode errors (Norman).** Hiding the message box created a hidden
mode: the reader had to answer the card before they could talk again,
and nothing said so. Moving focus into the box showed it again, so the
same action had two results. The new layout has no mode: the box is
always there, and a typed reply is a valid answer.
- **Nielsen heuristic #3, user control and freedom.** Esc dismisses and
the box stays usable. People can step out of a question without hunting
for the card in scrollback.
- **Nielsen heuristic #4, consistency and standards.** The question now
looks and acts like the rest of the composer dock (queued messages,
pending auth). The ask also follows the agent-tool convention:
- [Claude
Code](https://docs.anthropic.com/en/docs/claude-code/permissions) shows
its permission prompt at the input, with numbered options and Esc to
cancel.
- [VS Code agent
approvals](https://code.visualstudio.com/docs/agents/run/approvals) put
the approval controls in the chat input.
- **Why before what.** A record after the final message keeps the
transcript in reading order. The old card sat above the reasoning that
motivated it.
## Screenshots
Single choice question, dark and light:


Several open questions, "2 of 3" (multi_choice plus text), dark and
light:


A typed answer in the message box:

Answered: the transcript records show both answers, and the box is back
to "Message Junior…":

Mobile, dark and light, and a tall form that scrolls inside the dock:
<img width="300" alt="Mobile question, dark"
src="https://junior-prod.sentry.dev/public/artifacts/1a01af3b-a380-44c7-9ba4-f304b4e98481.png">
<img width="300" alt="Mobile question, light"
src="https://junior-prod.sentry.dev/public/artifacts/e79cc360-97d0-4400-b598-48851e881828.png">
<img width="300" alt="Mobile tall form"
src="https://junior-prod.sentry.dev/public/artifacts/742b2f28-c7bb-42bf-8edd-ec0087ce2da1.png">
## Supersedes #2533's hide-composer approach
#2533 (for #2508) hid the message box and queued messages while a
question waited, so the question was the last thing on the page. This PR
removes that hiding. Each #2533 concern is still covered:
- **Draft text and images stay.** The message box no longer hides or
unmounts, so its text and images stay through a question, an answer, and
a Dismiss.
- **Stop is available during a Turn.** The message box always shows, and
`onStop` still depends only on `stoppable`.
- **A tall card pinned at its end (#2508).** The transcript shows only a
one-line record, so nothing tall is pinned. The docked form scrolls
inside the dock: up to 50vh on desktop, and the dock's 55% cap on
mobile. Its title and question stay in view. The tall-question e2e
checks this on desktop and mobile.
- **The question is the obvious next thing.** It sits in the fixed dock
directly above the message box. It stays in view at any transcript
scroll position, and it takes focus after a palette or list switch on
desktop.
- **Answering never needs a mode switch.** #2533 needed rules such as
"do not hide while focused" and "Dismiss brings it back". With no hidden
state, those rules are no longer needed.
## Testing
- New `e2e/composer-questions.spec.ts`, run against the mock
Conversations:
- The question docks with the message box visible, desktop and mobile.
- The transcript record shows the open state, then the answer.
- The stepper keeps picks across steps. A number key answers one
question; then picks on another plus a typed message go out in one Send,
picks first, and the typed words answer a third.
- A typed key moves to the message box, and a typed message answers.
- Respond lands in the box under a question.
- Scroll to context, desktop and mobile: load does not scroll;
Previous/Next scroll to and mark the record; the title click jumps back;
an answer moves to the next question and its record; the page itself
does not scroll.
- A question that docks while the reader is scrolled up does not move
the transcript.
- Updated scenarios:
- Tall question in `conversations-event-log.spec.ts`: docked, Esc
dismiss, record says Dismissed.
- Palette switch in `command-palette.spec.ts`: the question takes focus.
- `review-desk.spec.ts`: docked picks go out before the typed message
with no confirm; picks in the details panel still get the confirm.
- `tests/transcriptListRows.test.ts`: asks move to the end of their
Turn, seq order holds, and activity merges around them.
- Checks: `pnpm --filter @sentry/junior-dashboard typecheck`, the
dashboard vitest suite (425 tests), `pnpm file-length:check`,
`test-architecture:check`, `dashboard-style:check`, dashboard lint,
`ast-grep:lint`.
- Full dashboard e2e: 135 of 138 passed with 4 workers. The 3 that timed
out under load (`conversation-send`, `conversations-event-log` inspect,
`conversations` views) pass when rerun alone.
## Frameshift changes
I diffed each of the 103 changed screenshots against its baseline
(report for f56e1f0):
- **85: the two new mock Conversations and the Inbox count.**
- 28 show only the Inbox count on the navigation rail.
- 10 show only the Inbox count in the top bar.
- 47 show the Conversation list, desktop and mobile, with the two new
rows. In some of these the row under the cursor also changes, because
the rows below the new ones move down.
- **4: the docked question, as intended.**
- `conversations-pinned` (dark and light): the open question docks above
the message box.
- `conversation-unsent-answers` (desktop and mobile): the confirm now
covers the docked form, and the transcript shows the "Asked …" record.
The details panel lists only this Conversation's items, because the
`review-desk.spec.ts` mock now applies the `conversationId` filter.
- **2: report totals.** On `locations` (desktop and mobile), private
Conversations go from 4 to 6, because the new mock Conversations count
as private.
- **15: noise that also happens on main.**
- Five `conversation-attachment` views and
`conversation-long-transcript-touch` stop at a different scroll
position.
- `conversation-share-details` and `conversation-event-log-virtual` show
or hide a hover tooltip.
- Four views catch a different video frame.
- `settings-mcp` has a random port.
- `person-profile` was captured before its charts loaded.
- `settings-notifications` differs only in anti-aliasing.
- For the attachment, long-transcript, and share views, I ran the specs
twice on main: main differs from itself in the same areas.
No layout, spacing, or transcript change appears outside the question
rows and the docked question.
## Follow-ups (out of scope)
- Notices and action items without a `request` do not dock. Their
transcript record links to the review desk.
- The details panel "Needs you" list still repeats the open question.
That belongs with the Inbox bundles work.
Mock preview: `JUNIOR_DASHBOARD_MOCK_CONVERSATIONS=true pnpm dev`, then
open **Roll out payments-v42** or **Plan the billing migration**.
<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A29bc0bc7abd06247a0e0286293c42573 -->
--
[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/agent%3A29bc0bc7abd06247a0e0286293c42573/?project=4510944073809921)
<!-- junior-session-footer:end -->
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>
Co-authored-by: David Cramer <[email protected]>
This was referenced Nov 20, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move capability credential enablement to a minimal jr-rpc issue-credential flow implemented as a bash custom command path, and remove remaining legacy rpc-style surfaces.
This change keeps credentials out of sandbox env/files and relies on sandbox network-policy header transforms for delivery. It also tightens the GitHub broker contract around installation-based issuance with short-lived leases and turn-local reuse.
I considered keeping the previous tool/rpc interception path, but that left two overlapping invocation surfaces and made behavior harder to reason about. Consolidating on the bash command path keeps the API surface small and aligns with the runtime model we want.
Additional context: specs and skill docs are updated to describe the new flow, old jr-rpc credential command references are removed, and focused tests/evals now cover custom-command routing, lease enable/reuse behavior, and header-transform injection semantics.