Skip to content
Source
Sign inSign up
pingdotgg/t3code

Polish chat UI and provider prompts #2451

Closedsandersonstabo(GitHub profile, opens in a new tab)wants to merge 16 commits intomain fromrefs/pull/2451/headopened View on GitHub

Polished the UI.

Checks

  • bun fmt
  • bun lint
  • bun typecheck

Note

Polish chat UI, add LLM-generated tool work log summaries, and surface Claude auth status

  • Adds an LLM-generated one-line summary for tool work log entries via a new summarizeToolWorkLog RPC endpoint backed by Claude, Codex, Cursor, and OpenCode providers; results are cached in IndexedDB and deduplicated in-flight via useToolWorkLogFriendlyLine.
  • Reworks the chat TraitsPicker into per-descriptor independent triggers; 'fastMode' is renamed to 'Speed' with Fast/Normal labels and rabbit/turtle icons; thinking-like booleans get a direct toggle button.
  • Overhauls MessagesTimeline rows: timestamps move to tooltips, copy buttons use ghost style, work log sections hide neutral entries and show success/failure/neutral indicators with expand/collapse, and the completion divider shows elapsed duration.
  • Adds OpenCode Go/Zen tab filtering and a disabled-provider rail in locked mode to ModelPickerContent; background scroll is suppressed while the picker is open.
  • Detects unauthenticated Claude CLI state via claude auth status and surfaces it as a provider error banner.
  • Switches font stacks to bundled DM Sans Variable and JetBrains Mono (dropped Google Fonts); updates focus-visible, inline code, and link styles globally.
  • Adds a user-facing 'Tool call summaries' toggle in General Settings bound to a new toolCallSummaries setting.
  • Risk: MAX_VISIBLE_WORK_LOG_ENTRIES drops from 6 to 1, so only the most recent work log entry is shown by default.
Macroscope summarized 6d9d3be.

Note

Medium Risk Adds new LLM-powered text-generation path exposed via WebSocket RPC and adjusts runtime session lifecycle handling, which can affect chat state correctness and provider interactions. Most other changes are UI polish, but the new summarization and turn-clearing logic warrant extra verification across providers.

Overview Tool work-log summaries: Introduces generateToolWorkLogSummary across all text-generation backends (Claude/Codex/Cursor/OpenCode), adds prompt/schema plumbing + sanitization helpers, and exposes it via a new WS_METHODS.gitSummarizeToolWorkLog RPC; desktop/web settings now include an opt-in toolCallSummaries flag (tests/layers updated accordingly).

Provider/runtime behavior tweaks: Improves provider runtime ingestion guards to force-clear stuck active turns when a turn.completed arrives without a turn id, and ensures runtime.error clears activeTurnId; Claude provider probing now checks claude auth status to surface an explicit unauthenticated error state.

UI polish: Renames provider option label “Fast Mode” → “Speed”, filters provider-supplied Other user-input options, enables OpenCode interaction-mode toggle, and refines multiple chat/git surfaces (branch picker UX, commit dialog redesign with diff stats, markdown file-link labels, shortcut styling, diff/plan/sidebar styling, and self-hosted fonts).

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6d9d3be7e04abfd028f4c03ddad4ae6f0fc3b656. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 3084fa53-0cea-44f7-95f5-54e879fdf0fd

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Tip

      💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

      Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

      • Generate code and open pull requests
      • Plan features and break down work
      • Investigate incidents and troubleshoot customer tickets together
      • Automate recurring tasks and respond to alerts with triggers
      • Summarize progress and report instantly

      Built for teams:

      • Shared memory across your entire org—no repeating context
      • Per-thread sandboxes to safely plan and execute work
      • Governance built-in—scoped access, auditability, and budget controls

      One agent for your entire SDLC. Right inside Slack.

      👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value).


      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. 💡 Codex Review

      Here are some automated review suggestions for this pull request.

      Reviewed commit: c967b6d2ed

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

      @@ -272,4 +293,4 @@
      272293 const stripped = prompt.replace(/^Ultrathink:\s*/i, "");
      273294 onPromptChange(stripped);
      274295 }
      275- updateDescriptors(replaceDescriptorCurrentValue(descriptors, descriptor.id, value));
      296+ updateDescriptors(replaceDescriptorCurrentValue(visibleDescriptors, descriptor.id, value));

      P1 Badge Preserve hidden traits when updating one descriptor

      When hiddenDescriptorIds is used, replaceDescriptorCurrentValue is called with visibleDescriptors only, so changing a single trait rebuilds modelOptions from a partial descriptor list and drops every hidden option. This is reachable in the new split-trigger flow (each popup hides sibling descriptors), and it can silently reset previously selected provider options (e.g., reasoning/context settings) on the next change.

      Useful? React with 👍 / 👎.

      @@ -372,2 +367,19 @@
      372- </p>
      373- </div>
      367+ </div>
      368+ <div className="flex items-center gap-1.5 pe-1 opacity-0 transition-opacity duration-200 focus-within:opacity-100 group-hover:opacity-100">
      369+ {canRevertAgentWork && (
      370+ <Button
      371+ type="button"
      372+ size="xs"
      373+ variant="ghost"
      374+ disabled={ctx.isRevertingCheckpoint || ctx.isWorking}
      375+ onClick={() => ctx.onRevertUserMessage(row.message.id)}
      376+ title="Revert to this message"
      377+ >
      378+ <Undo2Icon className="size-3" />
      379+ </Button>
      380+ )}
      381+ <Tooltip>
      382+ <TooltipTrigger
      383+ render={<p className="text-right text-muted-foreground text-sm" />}
      384+ >
      385+ {formatChatTimestamp(row.message.createdAt)}

      P2 Badge Refresh relative timestamps after initial render

      This row now renders relative time via formatChatTimestamp(...), but non-streaming message rows have no ticking state, so labels like 59s ago stop updating until an unrelated re-render happens. The new chat timestamp UX therefore becomes stale during idle sessions and can mislead users about message recency.

      Useful? React with 👍 / 👎.

    4. Fixed this group to centered vertically correctly...

      Old: image

      New: image

    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      4 blocking correctness issues found. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    6. Thank you so much for this work! Going through it all and will leave my thoughts as I look at each part

      Biggest thing: There's a regression on starting new threads where the chat view gets populated, then a big visible repaint happens before the thread actually starts moving. Def need that fixed before we can ship.

      Here's me going through each part:

      1. The "glow" is a bit much on the updated input box

      2. Blur is a little too intense but I'm convince-able

      3. I hate how this looks compared to the inline hit on MacOS. IMO this is a different enough use case and not using shortcut icons is fine

      image
      1. This is the dumbest thing ever but I don't like how the icons look with lowercase text (which is common for branches). Just feels off image

      2. Old badges were too subtle, these feel a bit too much. No "hierarchy" either (like I should not care about remote)

      3. Two things here...

      12.1. I don't like the separated "Command + number" on MacOS, feels...weird. Might want to rethink the shortcut component at this point 🙃

      image

      12.2. We should do some kind of callout on "why you can't switch providers" here so users aren't as confused. Out of scope for this just writing it down before I forget to

      1. I liked the separator...

      2. I think we can just remove this "info" entirely, disabled is explicit

      3. Julius will fight you on this one

      28-31 I don't love the "selected" badge, I feel like badges are for different types of context and it's weird using them this way. I can be convinced but would also love to think of other treatments. The check we currently use on the permissions is decent? Not sure.

      1. This is so much better omfg

      2. How does this handle custom providers the user authenticates?

      3. I really don't like how the tool call "update", they blur for a sec or something and it takes a lot of my attention. Also the bright blue check makes me feel like I need to click. I want to make sure tool calls are "not eye grabbing in general"

      Also - do tool call summaries use inference? Not sure how I feel about that being on by default. Generally I think people care too much about tool calls and we were intentional with our decision to make them look uninteresting

      Overall this is great and I can't wait to merge it

    7. juliusmarmingecommented

      I like a lot of it, but removing the initials from the providers is a big no. I don't remember which color I chose for each of my codex accounts, but i do now i named them Work and Personal, so CW/CP is very useful information to me. CleanShot 2026-05-01 at 17 36 14@2x

      Also agree with Theo on the overuse of badges for selected state. checkmarks are fine?

      the sensitive column is waaaay too big as well: CleanShot 2026-05-01 at 17 36 53@2x

      Fixed providers using monospace for the time instead of sans

      I think this was to prevent layout shifts as it counts up

    8. sandersonstabo(GitHub profile, opens in a new tab)commented

      @juliusmarminge @t3dotgg I've applied to the fixes to the issues raised. I also added the option to answer to questionnaires with your own input, as it was low effort and probably a highly requested feature.

      Biggest thing: There's a regression on starting new threads where the chat view gets populated, then a big visible repaint happens before the thread actually starts moving. Def need that fixed before we can ship.

      I dont have this issue. Is it a mac issue? It loads instantly for me without any repaints.

      I also didn't touch anything about the shortcut component yet, I'm not sure what todo about it so I'm leaving it as.

      Questionnaire

      image image

      Added back the initials for colours

      Somewhat reckless in hindsight to remove this. Requested by Julius

      image

      Limited the tool calls visible to 1 at a time

      I made the tool calls show the latest tool call currently available. You can still expand it down.

      image

      Toned down the glow for when text area is focused

      I also thought it was too much, but didn't want to lose the intent with the focus, so I just made it consistent with what other inputs have as focus ring, but now it's toned down.

      image

      Moved checkbox to the right

      image

      Debadged most of the UI

      I agree that the badge usage was excessive and a checkmark is sufficient for most UI here. It now displays a blue checkmark. As requested by both

      image

      Fixed both icons under the text-area to not look weird.

      The issue was that it was not properly sized with the text. As requested by Theo

      image

      Updated model picker again

      Added an explanation for why models are missing by adding them back as disabled, with a tooltip on hover. Also added a slight 1 tw unit offset to give it room to breathe. as requested by Theo image

      Made tool call summaries default to off

      It uses inference as Theo suspected, using the same model as the text generation model. I would come back to this and suggest to create another model picker in settings allowing a small model like gpt-5-nano to generate summaries. Requested by Theo

      image

      Simplified visuals for the "worked for" dash

      image

      Removed the double highlight for buttons inside directory tab and per thread tab

      image

      Fixed revert button to be in the button group with copy prompt button

      image

      Preserved GitHub original colour

      During a pass to fix every icon to be consistently muted when it has a foreground text label, GPT accidentally overwrote GitHub's logo to be muted. I reverted this change to respect GitBub's branding guidelines.

      image

      Fixed dialogs under Connections to use correct vertical centering

      The dialogs for Connections used the vertical centering for a command menu (like search bar). I changed it to be middle to create a distinction between user expectations and what shadcn does.

      image

      Lowered blur tint for dialogs

      Lowered from sm (8px) to xs (4px). Requested by Theo

      Refactored the changed files card

      It was using the old style and had too much visual noise. I simplified it while preserving all details, and added the +- diff to be a consistent 4ch. This should hopefully allow easier visual scanning. I also added rounding to closest power when it reaches 1000 LoC (very unlikely). Also fixed various padding issues around the card.

      image

      Fixed visual profile of when a tool call errors with runtime errror

      When a tool call errored like this, its visual profile was all over the place. I made it fully red, to create a difference between a runtime error and normal error.

      image image

      Added blue checkmark when a model selected

      image

      Fixed top padding for on the model rail for model picker

      It was off by a pixel, so I fixed it. image

      I also did a lot of misc like fixing alignment and padding which was not important enough to write here, but I added my notes just in-case:

      # features
      added the ability to write your own answer in question tool call as a 4th option.
      
      # ui changes & fixes
      
      removed blur from tool call summaries on pop in
      
      fixed unintentional github logo color override
      fixed miss-sized branch icon for branch selector
      
      fixed reasoning dropdown not auto closing after value change
      
      fixed user messages horizontal padding being off by 4 px
      fixed tool calls card horizontal padding being off by 4 px
      
      replaced all selected badges in the prompt center to use a blue checkmark instead
      
      added a header to the tool calls card
      made toll calls auto collapsible to 1 tool call visible at all times
      fixed tool calls card bottom padding being off
      added tooltips when hovering of tool call indicators
      made tool call summaries default to false in settings
      made tool calls filter out empty tool calls to reduce useless information
      fixed correct radii on tool call items
      fixed tool call header not displaying when 1 tool call only is called
      
      removed the deeply nested bg highlight when hovering over thread archive button or new thread button
      
      fixed archive button not being consistent with style. added hover effect and fixed position and aligment
      fixed revert all changes button being misplaced
      
      fixed alert banner having missaligned icon
      decodexified the error language when codex is unauthenticated
      
      fixed table not using shadcn table primitive
      fixed wrong alignment of checkbox in environment variables
      
      fixed performance issue on color picker lagging out (when rapidly changing color)
      reverted removing initals from color badge
      
      added all providers back to model picker
      added a grayed out state if provider is not available because of lock
      added favorites tab to model picker
      made favorites tab filtered if locked provider is present
      replaced the selected badge with a blue checkmark instead
      added 1 tw unit worth of gap between extended tooltip in model picker
      fixed missing two pixels worth of padding inside model picker rail
      
      fixed search bar's search icon being highlighted to foreground when hovered
      
      fixed correct dialog placement in connections tab
      added blur to connections tab dialogs be consistent with search bar
      toned down blur to 4px for all dialog tints
      
      fixed markdown tables to have a fully opaque border as before it bleeds color in cross sections
      
      fixed wrong radii for file tree explorer with the changed files card in mind
      decodexified the header to changes files and collapses large numbers to the nearest unit (k, M)
      made the +- diff for each file changed 4ch to make it easier to visually scan
      fixed the +- diff for each file tree item being off by a few px
      fixed various padding issues in the changed files card
      fixed padding issue for file tree viewer
      changed the highlight color of file tree to be consistent with already established uii
      
      fixed inconsistent gap px for chat responses/input for message metadata/opts
      
      fixed misalignment of the icon, text and cross in the error/warning banner
      
      muted the focus-ring the text area
      

      Fixed inconsistent behaviour when Claude is unauthenticated

      I noticed that Codex and Claude behave differently in T3 Code when unauthenticated, where Codex generates an alert banner. I made this the same behaviour for Claude also.

    9. sandersonstabo(GitHub profile, opens in a new tab)commented

      Some more fixes

      features
      added tabular number rendering for relative timestamps/timers to reduce layout shift
      preserved all provider questionnaire options while still adding an Other/custom answer option
      
      ui changes & fixes
      added pt-4 spacing to the changed files card
      changed changed files card spacing to better match tool call card spacing
      fixed flat/root-level changed files being indented as if they were inside a directory
      added pointer cursor to tool call show more controls
      restored assistant response copy button in the metadata/action row
      fixed user message metadata action order so copy is the rightmost button
      moved assistant response copy button to the left side of response metadata
      changed message metadata timestamps to text-xs
      added tabular number styling to message metadata timestamps, working timers, completion dividers, sidebar timestamps, diff timestamps, and plan sidebar timestamps
      made the Tasks sidebar button match the Build/Plan toggle active style
      centered task sidebar step icons and text vertically
      updated task sidebar styling to use shared UI color tokens where appropriate
      restored blue and emerald row tint highlights for active/completed task steps
      replaced the composer send loading-circle SVG with the shared spinner
      removed the faint nested card/background from the root "Pick a thread to continue" empty state
      changed code block copy button to use shared Button with variant=ghost
      removed custom framed border/background styling from the code block copy button
      
      review fixes
      fixed provider user-input options being silently truncated to three
      fixed TraitsPicker hook order by moving useState before the early return
      fixed Worked for X duration using the previous assistant message timing instead of the current assistant row
      added/updated tests for custom user-input options and completion divider duration
    10. 
      ui changes & fixes
      replaced plain "Plan Ready" label with Badge component in composer follow-up banner
      added pointer cursor to pending user-input cards in non-other mode
      replaced live LiveMessageMeta timer with static timestamp on completed assistant messages
      removed unused LiveMessageMeta and formatMessageMeta helpers
      added force-clear of stuck active turns when lifecycle guard blocks turn.completed/runtime.error
      properly transition latestTurn to settled state on thread.session-set, filling completedAt and clearing pendingSourceProposedPlan
      added completionDividerDuration input to use turn-level duration for completion divider
      added showAssistantMeta row field so only the terminal assistant message shows metadata/copy
      
      review fixes
      added completionDividerDuration to all existing test fixtures
      added test for turn-level completion divider duration propagation
      added test asserting only terminal assistant message shows showAssistantMeta: true
      added showAssistantMeta to isRowUnchanged stability check
    11. as for the custom answer, you can do this today? and since we're using the same composer all features from it still works like file tagging etc:

      https://github.com/user-attachments/assets/c3fb0356-2b26-4407-b11d-e2b09f78b214

    12. @@ -179,5 +205,16 @@
      179- </span>
      180- ) : null}
      181- </div>
      182- {isSelected ? <CheckIcon className="size-3.5 shrink-0 text-blue-400" /> : null}
      183- </button>
      205+ </>
      206+ );
      207+ return (
      208+ <div
      209+ key={`${activeQuestion.id}:${option.label}`}
      210+ role="button"
      211+ tabIndex={isResponding ? -1 : 0}
      212+ aria-disabled={isResponding}
      213+ onClick={() => {
      214+ if (isResponding) return;
      215+ handleOptionSelection(activeQuestion.id, option.label);
      216+ }}
      217+ className={className}
      218+ >
      219+ {content}
      220+ </div>
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High chat/ComposerPendingUserInputPanel.tsx:207

      The change from <button> to <div role="button"> breaks keyboard activation. While the div has tabIndex={0} and role="button", it lacks an onKeyDown handler for Enter and Space keys. Users who tab to an option cannot activate it with the keyboard — the original <button> handled this natively.

      -            <div
      +            <button
                     key={`${activeQuestion.id}:${option.label}`}
      -              role="button"
      -              tabIndex={isResponding ? -1 : 0}
      -              aria-disabled={isResponding}
      +              type="button"
      +              disabled={isResponding}
                     onClick={() => {
                       if (isResponding) return;
                       handleOptionSelection(activeQuestion.id, option.label);
                     }}
                     className={className}
                   >
                     {content}
      -            </div>
      +            </button>
      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx around lines 207-220:
      
      The change from `<button>` to `<div role="button">` breaks keyboard activation. While the `div` has `tabIndex={0}` and `role="button"`, it lacks an `onKeyDown` handler for Enter and Space keys. Users who tab to an option cannot activate it with the keyboard — the original `<button>` handled this natively.
      
      Evidence trail:
      apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx lines 207-219 at REVIEWED_COMMIT: `<div role="button" tabIndex={...} onClick={...}>` with no `onKeyDown` handler. git_diff MERGE_BASE..REVIEWED_COMMIT shows original code used `<button type="button" onClick={...}>` which natively handles Enter/Space. WAI-ARIA Button Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/button/
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium components/ChatView.tsx:2803

      onSelectActivePendingUserInputOption clears the draft's customAnswer by calling togglePendingUserInputOptionSelection, but it no longer clears promptRef.current. When the user then sends a message, onSend reads promptRef.current directly as promptForSend and uses it for deriveComposerSendState and appendTerminalContextsToPrompt. This causes the stale custom answer text to be sent as a new message even though the composer visually appears empty.

      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/components/ChatView.tsx around line 2803:
      
      `onSelectActivePendingUserInputOption` clears the draft's `customAnswer` by calling `togglePendingUserInputOptionSelection`, but it no longer clears `promptRef.current`. When the user then sends a message, `onSend` reads `promptRef.current` directly as `promptForSend` and uses it for `deriveComposerSendState` and `appendTerminalContextsToPrompt`. This causes the stale custom answer text to be sent as a new message even though the composer visually appears empty.
      
      Evidence trail:
      ChatView.tsx:2780-2810 - `onSelectActivePendingUserInputOption` does not clear `promptRef.current`; ChatView.tsx:2822 - `onChangeActivePendingUserInputCustomAnswer` sets `promptRef.current = value`; pendingUserInput.ts:76-101 - `togglePendingUserInputOptionSelection` returns `{customAnswer: ""}` clearing the draft but not the ref; ChatComposer.tsx:1943-1948 - editor value is `activePendingProgress.customAnswer ?? ""` when pending, `prompt` otherwise; ChatComposer.tsx:1117-1120 - sync effect only runs when draft store `prompt` changes; ChatComposer.tsx:1310-1327 - `onPromptChange` routes to pending handler (doesn't call `setPrompt`) so draft store `prompt` never changes during pending input; ChatView.tsx:2409-2412 - `onSend` early-returns when `activePendingProgress` is truthy; ChatView.tsx:2424 - `promptForSend = promptRef.current` when `activePendingProgress` is null
    13. quite a bit of conflicts, mind resolving them?

    14. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low

      https://github.com/pingdotgg/t3code/blob/07094ed060b13a649957e6d1bb7f70b578906617/apps/web/src/components/ChatMarkdown.tsx#L407

      The removal of fileLinkParentSuffixByPath breaks disambiguation for files with identical basenames. When two links point to different files named MessagesTimeline.tsx in different directories, both now display as "MessagesTimeline.tsx" instead of "MessagesTimeline.tsx · components/chat" and "MessagesTimeline.tsx · src/components", making them indistinguishable to users.

      Also found in 1 other location(s)

      apps/web/src/components/ChatMarkdown.browser.tsx:105

      The test disambiguates duplicate file basenames inline (lines 105-125) expects links with disambiguating parent suffixes like MessagesTimeline.tsx · components/chat, but the implementation in ChatMarkdown.tsx had this disambiguation logic removed (the fileLinkParentSuffixByPath computation and usage were deleted). The test expects · separators and parent directory suffixes that are no longer generated, so this test will fail.

      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/components/ChatMarkdown.tsx around line 407:
      
      The removal of `fileLinkParentSuffixByPath` breaks disambiguation for files with identical basenames. When two links point to different files named `MessagesTimeline.tsx` in different directories, both now display as `"MessagesTimeline.tsx"` instead of `"MessagesTimeline.tsx · components/chat"` and `"MessagesTimeline.tsx · src/components"`, making them indistinguishable to users.
      
      Evidence trail:
      git_diff MERGE_BASE..REVIEWED_COMMIT for apps/web/src/components/ChatMarkdown.tsx shows removal of `buildFileLinkParentSuffixByPath` function (lines ~259-310 in old file), removal of `fileLinkParentSuffixByPath` useMemo (old ~497-499), and removal of parentSuffix label logic (old ~513-516). New code at line 437-438 constructs label as `[fileLinkMeta.basename]` only. The MarkdownFileLink component (lines 272-398 in new file) renders `label` as visible text in <span> and uses `displayPath` only in a TooltipPopup on hover.
      
      Also found in 1 other location(s):
      - apps/web/src/components/ChatMarkdown.browser.tsx:105 -- The test `disambiguates duplicate file basenames inline` (lines 105-125) expects links with disambiguating parent suffixes like `MessagesTimeline.tsx · components/chat`, but the implementation in `ChatMarkdown.tsx` had this disambiguation logic removed (the `fileLinkParentSuffixByPath` computation and usage were deleted). The test expects ` · ` separators and parent directory suffixes that are no longer generated, so this test will fail.
      
    15. quite a bit of conflicts, mind resolving them?

      I think I've resolved all conflicts now, and I've done my last pass now, I think I'm finished now

    16. 💡 Codex Review

      Here are some automated review suggestions for this pull request.

      Reviewed commit: 6892790500

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

      @@ -1209,13 +1209,15 @@
      12091209 if (conflictsWithActiveTurn || missingTurnForActiveTurn) {
      12101210 return false;
      12111211 }
      1212- // Only the active turn may close the lifecycle state.
      12131212 if (activeTurnId !== null && eventTurnId !== undefined) {
      12141213 return sameId(activeTurnId, eventTurnId);
      12151214 }
      1216- // If no active turn is tracked, accept completion scoped to this thread.
      12171215 return true;
      12181216 default:
      12191217 return true;
      12201218 }
      12211219 })();
      1220+
      1221+ const shouldForceClearActiveTurn = shouldApplyThreadLifecycle
      1222+ ? false
      1223+ : event.type === "turn.completed" && activeTurnId !== null;

      P1 Badge Restrict force-clear to missing-turn completions

      The new shouldForceClearActiveTurn condition fires for any blocked turn.completed event, including the normal out-of-order case where an older turn finishes after a newer turn has already become active (conflictsWithActiveTurn). In that scenario this branch clears activeTurnId and applies the stale event’s status, which can incorrectly mark an in-progress turn as finished/error and desynchronize thread lifecycle state.

      Useful? React with 👍 / 👎.

      @@ -1550,4 +1581,13 @@
      15501581 ? { providerInstanceId: event.providerInstanceId }
      15511582 : {}),
      15521583 runtimeMode: thread.session?.runtimeMode ?? "full-access",
      1553- activeTurnId: eventTurnId ?? null,
      1584+ activeTurnId: null,
      1585+ lastError: runtimeErrorMessage,
      1586+ updatedAt: now,
      1587+ },
      1588+ createdAt: now,
      1589+ });
      1590+ } else if (activeTurnId !== null) {
      1591+ yield* Effect.logWarning(
      1592+ "provider runtime ingestion: lifecycle guard blocked runtime.error but active turn is stuck — force-clearing",
      1593+ {

      P1 Badge Keep mismatched runtime errors from clobbering active turns

      When runtime.error is blocked by the lifecycle guard due to a turn-id mismatch, this new fallback still force-clears the active turn and sets session status to error. Delayed errors from a previous turn can therefore terminate and mislabel a currently running turn in the same thread, even though the guard correctly identified the event as unrelated to the active turn.

      Useful? React with 👍 / 👎.

    17. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low

      https://github.com/pingdotgg/t3code/blob/68927905005a4ae23fb5f76762f17c3d358ac287/apps/server/src/provider/Layers/CodexAdapter.ts#L319

      If all options have label "other" (case-insensitive), withCustomUserInputOption filters them all out after the options.length === 0 check on line 337. This causes the function to return a question with an empty options array, violating the expectation that questions have at least one option. Move the options.length === 0 check to after the withCustomUserInputOption call, or check the filtered result.

      Also found in 1 other location(s)

      apps/server/src/provider/acp/CursorAcpExtension.ts:66

      If all options from Cursor have a label matching &#34;other&#34; (case-insensitive, trimmed), withCustomUserInputOption will filter them all out, resulting in an empty options array. The fallback [{ label: &#34;OK&#34;, description: &#34;Continue&#34; }] only triggers when question.options.length === 0 before filtering, not after. This can produce a UserInputQuestion with zero selectable options, likely causing UI issues or preventing the user from responding.

      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/server/src/provider/Layers/CodexAdapter.ts around line 319:
      
      If all options have label "other" (case-insensitive), `withCustomUserInputOption` filters them all out after the `options.length === 0` check on line 337. This causes the function to return a question with an empty `options` array, violating the expectation that questions have at least one option. Move the `options.length === 0` check to after the `withCustomUserInputOption` call, or check the filtered result.
      
      Evidence trail:
      apps/server/src/provider/Layers/CodexAdapter.ts lines 319-349 (function toUserInputQuestions): options.length === 0 check at line 337 occurs before withCustomUserInputOption call at line 344.
      apps/server/src/provider/userInputOptions.ts lines 1-7: withCustomUserInputOption filters out all options where label.trim().toLowerCase() === 'other', potentially returning an empty array.
      
      Also found in 1 other location(s):
      - apps/server/src/provider/acp/CursorAcpExtension.ts:66 -- If all options from Cursor have a label matching "other" (case-insensitive, trimmed), `withCustomUserInputOption` will filter them all out, resulting in an empty `options` array. The fallback `[{ label: "OK", description: "Continue" }]` only triggers when `question.options.length === 0` *before* filtering, not after. This can produce a `UserInputQuestion` with zero selectable options, likely causing UI issues or preventing the user from responding.
      
      @@ -0,0 +70,21 @@
      70+ : hue < 300
      71+ ? [x, 0, chroma]
      72+ : [chroma, 0, x];
      73+
      74+ return `#${[red, green, blue]
      75+ .map((channel) =>
      76+ Math.round((channel + match) * 255)
      77+ .toString(16)
      78+ .padStart(2, "0"),
      79+ )
      80+ .join("")}`;
      81+}
      82+
      83+function ProviderCustomColorPanel(props: {
      84+ readonly value: string;
      85+ readonly onCommit: (value: string) => void;
      86+}) {
      87+ const { onCommit } = props;
      88+ const initialHsv = useMemo(() => hexToHsv(props.value), [props.value]);
      89+ const [hsv, setHsv] = useState(initialHsv);
      90+ const currentColor = hsvToHex(hsv.h, hsv.s, hsv.v);
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low settings/ProviderAccentColorPicker.tsx:83

      ProviderCustomColorPanel initializes hsv state from initialHsv, but useState only uses the initial value on first mount. If props.value changes while the popover is open (e.g., external state update), the hsv state stays stale and the color picker displays the wrong color. Consider adding a useEffect that calls setHsv(hexToHsv(props.value)) whenever props.value changes.

      +  useEffect(() => {
      +    setHsv(hexToHsv(props.value));
      +  }, [props.value]);
      +
         const currentColor = hsvToHex(hsv.h, hsv.s, hsv.v);
      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/components/settings/ProviderAccentColorPicker.tsx around lines 83-90:
      
      `ProviderCustomColorPanel` initializes `hsv` state from `initialHsv`, but `useState` only uses the initial value on first mount. If `props.value` changes while the popover is open (e.g., external state update), the `hsv` state stays stale and the color picker displays the wrong color. Consider adding a `useEffect` that calls `setHsv(hexToHsv(props.value))` whenever `props.value` changes.
      
      Evidence trail:
      apps/web/src/components/settings/ProviderAccentColorPicker.tsx lines 88-89 (useMemo + useState without useEffect sync), lines 83-86 (ProviderCustomColorPanel props), lines 201-203 (external value sync via useEffect in ProviderAccentColorPicker), apps/web/src/components/ui/popover.tsx (uses @base-ui/react/popover with Portal)
    18. Cursor Bugbot has reviewed your changes and found 2 potential issues.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6d9d3be7e04abfd028f4c03ddad4ae6f0fc3b656. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -6,0 +171,21 @@
      171+ lower.includes("enoent")
      172+ ) {
      173+ return new TextGenerationError({
      174+ operation,
      175+ detail: `${cliLabel(cliName)} is required but not available on PATH.`,
      176+ cause: error,
      177+ });
      178+ }
      179+ return new TextGenerationError({
      180+ operation,
      181+ detail: `${fallback}: ${error.message}`,
      182+ cause: error,
      183+ });
      184+ }
      185+
      186+ return new TextGenerationError({
      187+ operation,
      188+ detail: fallback,
      189+ cause: error,
      190+ });
      191+}
      cursor[bot](GitHub profile, opens in a new tab)commented

      Fully duplicated utility functions across two files

      Medium Severity

      Seven exported functions in apps/server/src/git/Utils.ts (toJsonSchemaObject, limitSection, extractJsonObject, sanitizeCommitSubject, sanitizePrTitle, sanitizeThreadTitle, normalizeCliError) are exact duplicates of functions already in apps/server/src/textGeneration/TextGenerationUtils.ts. The existing callers all import from TextGenerationUtils.ts, making the copies in git/Utils.ts unused dead code. Only sanitizeToolWorkLogSummaryLine is unique and actually imported from git/Utils.ts.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6d9d3be7e04abfd028f4c03ddad4ae6f0fc3b656. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -0,0 +1,7 @@
      1+import type { UserInputQuestionOption } from "@t3tools/contracts";
      2+
      3+export function withCustomUserInputOption(
      4+ options: ReadonlyArray<UserInputQuestionOption>,
      5+): ReadonlyArray<UserInputQuestionOption> {
      6+ return options.filter((option) => option.label.trim().toLowerCase() !== "other");
      7+}
      cursor[bot](GitHub profile, opens in a new tab)commented

      Function name contradicts its filtering-only behavior

      Low Severity

      withCustomUserInputOption implies it adds a custom option to the list (the "with" prefix typically means "including"), but the implementation only removes options labeled "Other". This naming inversion makes it easy for future callers to misunderstand the function's purpose — it strips provider-supplied "Other" entries so the UI can supply its own custom input mechanism separately.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6d9d3be7e04abfd028f4c03ddad4ae6f0fc3b656. Configure [here](https://www.cursor.com/dashboard/bugbot).
    19. @@ -648,3 +617,3 @@
      648617 );
      649618
      650619 const authRowNode = (
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low settings/ProviderInstanceCard.tsx:619

      When a provider is authenticated with an email address, summary.detail (containing server messages like rate limits or deprecation notices) is no longer rendered. The previous code showed summary.detail for all providers, but the refactoring moved the detail popover inside the hasAuthenticatedEmail === false branch, so authenticated users never see these messages.

      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/components/settings/ProviderInstanceCard.tsx around line 619:
      
      When a provider is authenticated with an email address, `summary.detail` (containing server messages like rate limits or deprecation notices) is no longer rendered. The previous code showed `summary.detail` for all providers, but the refactoring moved the detail popover inside the `hasAuthenticatedEmail === false` branch, so authenticated users never see these messages.
      
      Evidence trail:
      1. Old code diff (MERGE_BASE): `{summary.detail ? <span>- {summary.detail}</span> : null}` was outside both ternary branches at line ~668 of old file. See git_diff output for `apps/web/src/components/settings/ProviderInstanceCard.tsx`.
      2. New code (REVIEWED_COMMIT): lines 619-660 of `ProviderInstanceCard.tsx` show `summary.detail` Popover is inside `hasAuthenticatedEmail === false` branch only.
      3. `apps/web/src/components/settings/providerStatus.ts` lines 62-70: `getProviderSummary()` returns `detail: provider.message ? punctuateProviderMessage(provider.message) : null` when `provider.auth.status === 'authenticated'`, confirming `detail` can be non-null for authenticated providers.
      @@ -0,0 +111,21 @@
      111+ workEntry.id,
      112+ workEntry.label,
      113+ workEntry.toolTitle,
      114+ workEntry.itemType,
      115+ workEntry.requestKind,
      116+ workEntry.command,
      117+ workEntry.detail,
      118+ workEntry.tone,
      119+ ],
      120+ );
      121+
      122+ useEffect(() => {
      123+ const workEntry = workEntryRef.current;
      124+ const modelSelection = modelSelectionRef.current;
      125+
      126+ if (!toolCallSummaries || !cwd || !shouldSummarizeWorkLogEntry(workEntry)) {
      127+ setLine(null);
      128+ return;
      129+ }
      130+
      131+ const key = cacheKey(environmentId, workEntry.id, modelKey);
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium hooks/useToolWorkLogFriendlyLine.ts:122

      When workEntry changes (e.g., different id), the line state is not reset to null before the new async load begins. If the same component instance receives a different workEntry prop (common in virtualized/recycled lists), the previously loaded summary string remains visible for the new entry until the fetch completes, causing a brief flash of incorrect summary text.

        useEffect(() => {
          const workEntry = workEntryRef.current;
          const modelSelection = modelSelectionRef.current;
      
          if (!toolCallSummaries || !cwd || !shouldSummarizeWorkLogEntry(workEntry)) {
            setLine(null);
            return;
          }
      
      +    setLine(null);
          const key = cacheKey(environmentId, workEntry.id, modelKey);
      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/hooks/useToolWorkLogFriendlyLine.ts around lines 122-131:
      
      When `workEntry` changes (e.g., different `id`), the `line` state is not reset to `null` before the new async load begins. If the same component instance receives a different `workEntry` prop (common in virtualized/recycled lists), the previously loaded summary string remains visible for the new entry until the fetch completes, causing a brief flash of incorrect summary text.
      
      Evidence trail:
      File: apps/web/src/hooks/useToolWorkLogFriendlyLine.ts at REVIEWED_COMMIT. Line ~100: `const [line, setLine] = useState<string | null>(null);` — initial state is null. Lines ~122-160: The useEffect depends on `requestSignature` (which changes when workEntry changes). In the normal (non-early-return) path, `setLine` is only called inside `.then()` and `.catch()` of the async `loadFriendlyLine()`. No `setLine(null)` is called at the top of the effect before kicking off the async load, so the previous `line` value persists until the new promise settles.
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/6d9d3be7e04abfd028f4c03ddad4ae6f0fc3b656/apps/web/src/components/ChatMarkdown.browser.tsx#L105

      The test on lines 105-125 expects ChatMarkdown to disambiguate duplicate file basenames by showing parent directory suffixes (e.g., MessagesTimeline.tsx · components/chat vs MessagesTimeline.tsx · src/components), but the implementation removed fileLinkParentSuffixByPath in the diff, so both links now render as just MessagesTimeline.tsx without disambiguation. This causes the test to fail because the · suffix logic no longer exists.

      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/components/ChatMarkdown.browser.tsx around line 105:
      
      The test on lines 105-125 expects `ChatMarkdown` to disambiguate duplicate file basenames by showing parent directory suffixes (e.g., `MessagesTimeline.tsx · components/chat` vs `MessagesTimeline.tsx · src/components`), but the implementation removed `fileLinkParentSuffixByPath` in the diff, so both links now render as just `MessagesTimeline.tsx` without disambiguation. This causes the test to fail because the `·` suffix logic no longer exists.
      
      Evidence trail:
      1. apps/web/src/components/ChatMarkdown.browser.tsx lines 105-125 at REVIEWED_COMMIT: test expects links with names 'MessagesTimeline.tsx · components/chat' and 'MessagesTimeline.tsx · src/components'
      2. git_diff MERGE_BASE..REVIEWED_COMMIT on apps/web/src/components/ChatMarkdown.tsx: `buildFileLinkParentSuffixByPath` function entirely deleted (~line 289-340), `fileLinkParentSuffixByPath` useMemo removed, parentSuffix logic in label construction removed, separator changed from ' · ' to ' @ '
      3. git_grep for 'fileLinkParentSuffixByPath' at REVIEWED_COMMIT returns no results — the function no longer exists anywhere in the codebase
    20. Any update on this @juliusmarminge?

    21. split up all the ui polish to separate small PRs

    22. juliusmarminge closed this

Sign in to join this conversation.