Render all tool activity inline: edit ribbons, inline questions, bare terminal commands - #1731
Open
bra1nDump wants to merge 18 commits into
Open
Render all tool activity inline: edit ribbons, inline questions, bare terminal commands#1731bra1nDump wants to merge 18 commits into
bra1nDump wants to merge 18 commits into
Conversation
Gemini harness support is dead. Sessions recorded with Gemini tools fall back to the generic tool card. Harness selection UI and the CLI runner are untouched and tracked as follow-up.
A compact terminal row read 'Ran 1 command: git status' next to a terminal icon that already says what it is. The row is now the command itself; the action label remains only when no command can be extracted.
Write, MultiEdit, NotebookEdit, and CodexDiff join Edit and CodexPatch in the shared file-edit ribbon: file path header, +/- stats, and the full highlighted diff expanded by default with no card chrome. Edits above 40 changed lines start collapsed to a preview with a show-all control so one large edit cannot swallow the transcript.
The full-screen question modal is gone. A pending form whose tool call the transcript renders is answered there; one whose tool message never arrived renders the same inline form pinned above the composer. Nothing the agent is blocked on is dropped any more: empty forms and unknown kinds surface as a dismissible notice, an option-less question always accepts written text even when the producer refused it, and a question tool call with unrenderable input falls back to the ordinary card so its permission footer stays reachable.
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.
Context for reviewers new to this area
Happy is three cooperating projects:
slopus/happy) — the mobile/web app (packages/happy-app), plus the legacy CLI (packages/happy-cli) and shared wire types (packages/happy-wire). When docs say "mobile app", they meanhappy-app.slopus/happy-agent— the coding-agent backend ("Happy Agent" / Rig). It produces the sessions the app renders and syncs them through the server as encrypted messages.Tool calls arrive in the app as
{ name, input, state, result }records. Rendering is keyed by tool name:sources/components/tools/knownTools.tsx— titles, icons, zod input schemas per tool.sources/components/tools/views/_all.tsx— registry mapping tool name → custom view component.sources/utils/toolDisplay.ts— name sets that decide chrome: compact row vs card vs inline ribbon.sources/sync/agentCommunications.ts— selectors for agent → user questions (request_user_inputcommunications riding on agent state).The direction of this PR: everything the agent shows or asks lives inline in the chat transcript. No full-screen modals, no hidden content, and nothing the agent is blocked on may ever be invisible.
What changed
1. Every edit tool renders as one expanded inline ribbon
Write,MultiEdit,NotebookEdit, andCodexDiffnow joinEditandCodexPatchin the sharedInlineFileEditBlock: file-path header, +/− stats, full highlighted diff, no generic card chrome, permission footer inside the ribbon. Diffs are expanded by default; an edit above 40 changed lines starts collapsed to a ~300 px preview with a "Show all N changed lines" control (fileEditMetrics.tsholds the threshold).2. Agent questions are inline, always answerable, never dropped
AgentQuestionModalis deleted. It had already become unreachable dead code once choice forms moved into the transcript; ~660 lines of parallel form logic went with it.RequestUserInputView/AskUserQuestionView→InlineQuestionForm).AgentQuestionBanner), keyed off a set of transcript question tool ids computed inSessionView.selectPendingCommunicationsno longer drops empty forms (they surface as a dismissible notice), an option-less question always accepts written text even if the producer sentallowCustom: false(shouldOfferCustomAnswer), and a question tool call with unparseable input falls back to the ordinary card so its permission footer stays reachable (hasRenderableQuestionContent).3. Terminal rows show the command
A compact terminal row used to read "Ran 1 command: git status" next to a terminal icon. It is now just
git status. The action label remains only when no command can be extracted (e.g.write_stdin).4. Gemini tool rendering removed
The Gemini harness is dead. Its tool views,
knownToolsentries (GeminiBash/Patch/Diff/Reasoning, lowercaseedit,execute,shell,search,read), and the flavor special-case inToolVieware gone. Old sessions containing Gemini tools fall back to the generic tool card. Harness selection UI (AgentInput, settings) and the CLI'ssrc/gemini/runner are untouched — follow-up.Tool rendering registry (state after this PR)
AskUserQuestion,request_user_inputEdit,MultiEdit,Write,NotebookEdit,CodexPatch,CodexDiffBash,CodexBash,exec_command,run_terminal_command,write_stdinRead,Grep,Glob,WebSearch,WebFetch,list_*, …Task,TodoWrite,spawn_agent,create_workspace, …Taskgroups nested toolsapply_patch,search_replace(GPT-harness raw shapes),update_planCompatibility
tool-call-end.result/isErrorfields (additive, old apps strip them).CodexPatchViewstill accepts every historicalchangesshape; unknown tool names still get the name-agnostic compact row.How to test
pnpm vitest run sourcesinpackages/happy-app— 1034 tests, all passing; new coverage inagentCommunications.spec.ts,toolDisplay.test.ts,fileEditMetrics.spec.ts./dev/file-edits) — ClaudeEdit, CodexCodexPatch,Write,MultiEdit, and a 60-line edit demonstrating the collapse control./dev/agent-question) — pending, answered, and superseded question states./dev/tools2) — the broader registry.Screenshots
Help welcome capturing these from the dev screens above (iOS + web is enough):
Related work
Producer-side normalization: slopus/happy-agent#12. It maps Codex
apply_patchinto theCodexPatch { changes, modify: { old_content, new_content } }shape this app's ribbon renders, so mobile never parses Codex patch grammar, and sends real tool results ontool-call-end— the optional fields this PR's wire schema accepts.Follow-ups (not in this PR)
apply_patch/search_replaceraw shapes into the ribbon (or normalize producer-side like happy-agent does).update_planas a checklist likeTodoWrite.CodexPatchView's shape tolerance andparseRawRequestUserInputQuestionsinto the sync layer.agentQuestion.title/submit/chooseMultiple/submitFailed/moreQuestions) — drop in a later sweep to avoid an 11-file churn here.