Skip to content

Search every thread from ⌘K, redirect agents from approval cards, tidy GitHub branches, and 13 smaller wins - #1768

Merged
currentbits merged 28 commits into
mainfrom
feat/search-redirect-pr-usage-polish
Oct 30, 2026
Merged

currentbits merged 28 commits into
mainfrom
feat/search-redirect-pr-usage-polish

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Sixteen improvements for running many agent threads at once: find anything any thread said, redirect an agent from its approval card, keep GitHub tidy, and a set of smaller usage, navigation and display wins.

Find and steer

Pull requests (#1763)

  • The GitHub branch is deleted after Solenta merges or closes a PR. This is on by default in Settings → Git → Pull requests, and covers the thread Merge button, the PR panel and the agent pr_merge tool. It never deletes the default branch, a fork's branch, or a branch another open PR still uses. A failed deletion never fails the merge; it leaves a quiet note in the thread.
  • PRs that request your review sort first in the inbox, with a "Review requested" badge.

Usage (#1764)

  • An even-pace tick on limit bars shows where you'd be if usage were spread evenly until the reset. It appears in the quota dialog, on the Usage page and in the thread usage strip.
  • The Usage page splits cost by token type: input, cached input, cache write and output, priced with the same table as the total. It shows "n/a" where a provider reports only a total.

Threads (#1765)

  • Opt-in: compact idle Claude threads before the 1-hour prompt cache expires. It's off by default because each compaction spends a turn. It runs once per idle stretch, one thread at a time, only above 50k context, and never during the daily budget pause.
  • Custom instructions for auto-generated thread titles (Settings → Threads).

Smaller wins (#1766, #1767)

  • solenta://new?prompt=…&project=… opens a new thread with the prompt filled in. It never sends on its own.
  • Snooze → Custom… lets you pick any date and time.
  • Right-click a file in the Changes panel for Open in editor and Reveal in Finder.
  • Long branch names truncate in the middle, so the distinguishing end stays visible. The full name is in the tooltip.
  • A chat width setting (Default / Wide / Full) in Settings → General → Display. The composer follows the same width.
  • Hover a tool row or turn fold to see when it happened and how long it took.

Checks (run locally on the merged branch, electron suite in a CI-matching environment)

  • npm run typecheck and the preload sync check: clean
  • npm run test:renderer: 3382 pass, 0 fail
  • npm run test:electron: 5383 pass, 0 fail
  • npm run test:core: 38 pass. npm run test:memory: 246 pass.
  • npx vite build: succeeds

Closes #1761, closes #1762, closes #1763, closes #1764, closes #1765, closes #1766, closes #1767.

🤖 Generated with Claude Code

Willem and others added 28 commits October 30, 2026 17:05
Plumb a new boolean setting through normalize/store methods, AppSettings,
the browser-dev twin, fakeCoder, and the GitPane checkbox, following the
autoSettleOnMerge / prCrossReview pattern exactly. Wires only the setting
for now; the actual branch-delete-on-merge/close behavior lands next.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Add evenPacePercent(win, now) to src/providerUsage.ts: a pure helper
that places a tick at how far through the window a constant spend
rate would be, null when resetsAt/windowSeconds are unknown. Draw a
1-2px tick on the quota dialog bar (percent used) and mirror it on
the opt-in thread usage strip (percent left), each with its own
tooltip and no tick when the provider never reported a reset/duration.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
CSS text-overflow can only ellipsize one end, which chews off the
distinguishing suffix of a generated branch name (e.g. "-35693f"). Add
a pure middleTruncate(s, max, endBias) helper to src/format.ts that
keeps the start and end with one "…" in the middle, splits on code
points so it never cuts a surrogate pair, and favours the tail when
endBias leans that way.

Apply it (with a title= tooltip carrying the untruncated value) to the
sidebar thread card branch, the worktree control's header branch pill,
the Changes/Git pane header branch, and PR rows in PrListView and
PrWorkspacePanel.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
)

solenta://new?prompt=...&project=... parses in deepLinks.js (prompt
URL-decoded via URLSearchParams, capped at 20k chars; project matched by
id, path or name against known projects, else null). main.js pushes
thread:newDraft to the renderer, which creates a thread in the resolved
project (or the currently selected one) and reuses the existing
restoreDraft path to pre-fill and focus the composer — the run is never
started, so a link can never trigger an agent by itself.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Add usageCostByType(report, range, today, prices) to src/usage.ts: it
mirrors electron/modelPrices.js's per-cell pricing formula so the four
token-type dollar amounts add up to summary.totals.costUsd for a fully
priced model, within rounding. A cell is only split when the recomputed
total matches the cell's own costUsd, so a provider-reported cost never
gets relabeled as a price-derived split, and the result is n/a across
the board when no price applies anywhere in range.

Wire it into the Usage page: each token-type Stat row (cached input,
uncached input, cache write, output) now shows its dollar amount next
to the token count, or "n/a" with no rates. modelPrices flows in from
AppSettings via App.tsx.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
New localStorage pref (coder.chatWidth, src/uiPrefs.ts) following the
same get/set/useSyncExternalStore shape as the transcript view mode.
Settings -> General -> Display gets a select next to the other display
toggles.

Applied as data-chat-width on the thread pane's <main>, which widens
the shared --thread-column CSS variable that both the transcript
column (.body > *) and the composer column already read -- so they
stay aligned with one override instead of two.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Both snooze menus (the right-click action menu's Snooze submenu and the
sidebar row's quick snooze button) gain a "Custom…" item. Native Menu.popup
cannot host an <input>, so it resolves with id "snooze:custom" and
ThreadCard opens CustomSnoozeDialog, a small modal (SettingsModal.module.css
chrome) with an <input type="datetime-local"> defaulting to tomorrow 9am,
min = now + 5 minutes. Submits through the same threads.setSnoozed IPC the
presets use. A typed value earlier than the floor is rejected client-side
too, since a typed value can bypass the input's min attribute.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Plumb two new AppSettings through store normalize/validate, ipc.ts and
the dev fixture, add electron/idleCompact.js (an opt-in, unref'd
scheduler that reuses the "Compact first" chip's native /compact
mechanism for Claude threads idle 50-58 minutes), wire it into
main.js, extend buildTitlePrompt with optional user instructions, and
add both controls to the Threads settings pane. Tests follow.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Tool rows had no indication of when they ran. Add title= tooltips
(local clock time, date prefix when not today, duration when an end
time is known) using the formatClockTime/formatTimeTooltip helpers
added to src/format.ts:

- ToolCallCard's header (message.createdAt)
- work-log StepLine rows: tool groups (start/end of the group's
  messages), command-result events, memory steps, and quiet event
  lines (message.createdAt)
- the collapsed turn folds: FocusTurnRow and RunHeaderRow, which now
  carry startedAt/endedAt (src/focusView.ts mapFocusTurns,
  src/runHeader.ts mapRunHeaders) alongside their existing label

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Add maybeDeleteHeadBranch, run after every in-app merge/close path:
worktrees-pr.js mergePr (thread-scoped Merge button), prWorkspace.js
closePr and mergePrAt (PR workspace panel / fleet list, mergePrStack
rides mergePrAt), and the agent pr_merge tool (prTools.js, wired from
orchServer.js).

Gated on the new deleteBranchOnMergeOrClose setting (default on).
Skips the default branch (checked locally via repoDefaultBranchAsync,
no network round trip), a branch another open PR still targets, and
fork PRs (isCrossRepository). Deletion goes over the project's own
REST token when one exists (keeps the gh-call-free API tests green),
falling back to `gh api -X DELETE .../git/refs/heads/<branch>`
otherwise; the agent-tool path always uses the REST client it already
has. A deletion failure is logged and left as a quiet event message on
the thread, but never fails the merge/close that already succeeded.

Tests: electron/test/pr-tools.test.js (maybeDeleteHeadBranch unit
tests plus a pr_merge wiring test).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Dedicated fake-gh tests for maybeDeleteHeadBranch's skip rules (off
setting, fork, default branch, another open PR) and failure handling,
plus wiring checks that closePr and mergePrAt actually call it and
respect the setting. Adds a setting-off regression test to the
existing mergePr suite in pr-checks.test.js.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…tte (#1761)

⌘K now searches user/assistant message text, not just thread titles. A
new threads.searchMessages IPC (AND-matched words, tool/event skipped,
30 hits newest-first, 3/thread cap) reuses the existing searchThreads
shard/worker scan so a 190MB+ store never blocks the main process - it
gets its own generation/worker slot since the palette already fires
searchThreads concurrently and a shared slot would have one cancel the
other. The palette shows a new "message" result ranked after threads,
snippet highlighted, and selecting one opens the thread and reveals the
message via ThreadView's existing revealMessageId prop (same mechanism
pinned-message jumps use).

Measured with a synthetic 148MB/600-thread fixture: searchMessages
takes ~130-200ms wall time but keeps the main-process event loop at
p99 ~1.3ms and never hydrates a transcript, so no cache was added.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Covers the scheduler's filter (window, threshold, setting off, non-
Claude, quota-wait/archived/trashed/snoozed/settled, global daily
budget, one-at-a-time, unref'd interval), the runner.js guard that
clears a stale idleCompactedAt claim on any other turn, and
buildTitlePrompt/settings plumbing for titleInstructions.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
#1766)

Changes panel file rows get onContextMenu (showContextMenu, same helper
ThreadCard's row menu uses): "Open in editor" (shell:openPath) and a
platform-labeled reveal item (shell:reveal) — "Reveal in Finder" on macOS,
"Show in Explorer" on Windows, "Show in folder" elsewhere. Both IPC
handlers already resolved a relative path against the thread worktree and
rejected anything outside it (ipc-files.js resolveAllowedShellPath predates
this and already worked for files, not just the worktree root), so no new
IPC was needed, just a pinning test for that containment check. A deleted
file disables Open in editor and reveals its parent folder instead, since
there is nothing on disk to open.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
auto-settle-settings.test.js and budget-spend.test.js deep-equal the
entire getSettings()/setSettings() object; add the two new fields so
they match normalizeSettings' defaults. Also add SettingsModal
coverage for the idle-compaction checkbox and the title-instructions
textarea.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
gh pr list --json now also asks for reviewRequests. parsePrListItem
takes an optional viewerLogin and sets reviewRequestedFromMe when a
reviewRequest names that login directly (team-only requests are left
alone: no team-membership data is cached anywhere to expand them).

listPrs itself does not resolve the login - it is a hot path hit by
many narrow gh-fixture tests, and probing would be an unexpected extra
gh/glab/az spawn for every one of them. Instead viewerLoginFor (new)
resolves it by reusing sourceControl's cached discovery probe (the
same one Settings already pays for) and the git:listPrs IPC handler
in ipc-git.js is the one place that calls both and merges them.

Tests: electron/test/list-prs.test.js covers the match/no-match/team
cases via listPrs's viewerLogin opt, and viewerLoginFor's own
resolution (including the GitLab-origin no-op case) separately.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
PrListItem.reviewRequestedFromMe (src/shared/ipc.ts) rides through to
triageInbox: it is now the primary sort key, ahead of the existing
merge/review/closeable/agent bucket order, so a PR GitHub explicitly
asked the signed-in user to review floats to the top regardless of
its CI/conflict/review-decision bucket. It never changes the bucket
itself. PrListView renders a small blue "Review requested" badge next
to the title on every row that has it (not just triaged ones).

Tests: test/prList.test.ts (bucket untouched, inbox sort order);
test/prListView.test.tsx (badge shown only on the matching row).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
A typed reply used to just queue or steer past an open tool-permission
card, leaving the agent to run the original ask anyway. Now a normal
send (not /btw, not a shell line) on a plain permission card declines
it and hands the typed text to the agent as the new direction: Claude
reads it off the tool-denial message and keeps going in the same turn,
providers whose deny can't carry text (Codex JSON-RPC, opencode/ACP)
deny then queue it as the next turn. The redirect text shows up as a
normal user message, and the card now hints that sending declines it.

Question cards and plan approvals are unaffected — only the plain
PermissionPrompt card (no questions, no plan, no inputRequest) redirects.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
A queued item already had an Edit button in the strip; Alt+Up now
reaches the same editor without a mouse trip, when the draft is empty
or the caret sits at position 0 with nothing selected (so it stays out
of the way of normal cursor movement in a typed draft). Bound as
composer.editLastQueued in keybindings.ts, so it is remappable and
shows up in the shortcuts sheet for free.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Reloads newly installed skills, plugins and MCP servers without
starting a new thread: kills the thread's warm/idle provider process
(runner-claude-sessions.js, Claude's only today) so the next turn
spawns fresh, while leaving sessionId untouched so the conversation
still resumes via --resume. Refuses while a run is active. Wired
through every IPC layer (handler, preload/ipcChannels table, the web
bridge's steer scope, devCoder and fakeCoder fixtures) and surfaced as
a PALETTE_ACTIONS entry plus an event message on success.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
respondPermission is synchronous, so the store/run-entry assertions
must run right after calling it, not after the ctrl-file waitFor —
the fake CLI can read the deny, settle the turn, and exit inside that
wait, racing runner.activeRunId(thread.id) back to null.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
# Conflicts:
#	electron/test/auto-settle-settings.test.js
#	electron/test/budget-spend.test.js
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T16:53:29.364544Z a43d46c PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a43d46c0c2

ℹ️ 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".

Comment thread electron/worktrees-pr.js
Comment on lines +1560 to +1564
await maybeDeleteHeadBranch({
store,
cwd,
prNumber: info.number,
headRefName: branch,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wait for an actual merge before deleting the head branch

When a merge is requested with auto: true, this cleanup runs as soon as gh pr merge succeeds, even though the PR can still be open awaiting checks. gh pr merge --help documents --auto as “Automatically merge only after necessary requirements are met”; mergeFlags forwards that flag and ghApiTryAsync falls back to the CLI for it. The cleanup's open-PR guard explicitly excludes this PR number, so it proceeds to delete the still-needed head branch. The same ordering exists in prWorkspace.mergePrAt. Confirm the PR is actually MERGED before deleting its branch, and defer cleanup for pending auto-merges.

Useful? React with 👍 / 👎.

Comment thread electron/worktrees-pr.js
Comment on lines +1611 to +1612
...(repoSlug ? ["-R", repoSlug] : []),
`repos/{owner}/{repo}/git/refs/heads/${branch}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Select the cleanup repository without passing -R to gh api

When a PR is merged or closed with an explicit repo, deleteHeadBranchRef always takes this CLI path and passes -R to gh api. Unlike gh pr, gh api does not support that flag: locally running this argument shape returns unknown shorthand flag: 'R' in -R. Its help states that repository placeholders use “the repository specified in the GH_REPO environment variable.” ghTryAsync forwards these arguments unchanged, so branch cleanup always fails for these calls. Use an explicit repository endpoint or set GH_REPO instead.

Useful? React with 👍 / 👎.

Comment thread electron/main.js
Comment on lines +573 to +576
sendWhenLoaded(focusMainWindow(), "thread:newDraft", {
prompt: link.prompt,
projectId: resolveProjectRef(link.project, store.getProjects()),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Buffer new-draft deep links until the renderer subscribes

When a solenta://new link launches the app or reopens its closed main window, this push can arrive before React subscribes. sendWhenLoaded only waits for page loading, while the preload's HELD_SELECTS buffer covers only thread:select and project:select, not thread:newDraft. Consequently the prompt is silently lost. Replaying the target preload with a push before subscription confirms that the existing thread-selection event is delivered afterward but the new-draft event is not. Add the new channel to the held-event path.

Useful? React with 👍 / 👎.

Comment thread electron/worktrees-pr.js
Comment on lines +598 to +599
if (reviewRequestedFromLogin(row && row.reviewRequests, viewerLogin)) {
item.reviewRequestedFromMe = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fetch review requests through the API-backed PR list

When a GitHub token is available, listPrsRaw uses ghApiTryAsync and the successful github.ghPr API translation rather than the CLI. That translator's list query does not request reviewRequests, and ghShape does not flatten that connection into the array expected here. Adding the field to PR_LIST_FIELDS therefore leaves row.reviewRequests undefined on this path, so explicitly requested reviews never receive the new badge or priority ordering. Extend the API query and normalization alongside the CLI field list.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit a7154f1 into main Oct 30, 2026
6 checks passed
@currentbits
currentbits deleted the feat/search-redirect-pr-usage-polish branch October 30, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment