Skip to content

Move Prompt Cache Timer setting to Agents pane, simplify expired state - #5691

Merged
Jinwoo-H merged 3 commits into
mainfrom
Jinwoo-H/prompt-cache-improve
Jun 18, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
Jinwoo-H/prompt-cache-improve

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

What

The prompt cache hit timer is the per-worktree countdown that warns you before your Claude agent's prompt cache expires (so you don't unknowingly send an expensive, fully-uncached message). It currently lives under Settings → General, which is the wrong home, and the sidebar timer shows a redundant expired label.

This PR:

  1. Moves the setting from General → Agents. It's a functional cost-awareness control tied to how Claude agents run — not a general app preference. It now sits next to "keep agent awake," another idle-triggered agent-behavior setting, which is where users look for this kind of config. Removes it from the increasingly cluttered General pane.
  2. Drops the expired text on the sidebar timer, keeping just the red timer icon. The color already conveys the expired state; the countdown text is only meaningful while the cache is alive. The tooltip still carries the full "next message re-sends full context as uncached tokens" explanation on hover.

How

  • Rename GeneralCacheTimerSection → AgentCacheTimerSection (component + i18n key path across all 5 locales).
  • Extract its search entry into a dedicated agent-cache-timer-search module, wired into the Agents pane search (so "prompt cache" / "ttl" / "cost" lands in Agents now); removed from general-search.
  • Mount the section in AgentsPane after AgentAwakeSetting; remove from GeneralPane.
  • Simplify the expired-state render in CacheTimer.tsx.

Testing

  • tsgo web typecheck: clean
  • verify:localization-catalog: all 8862 key references resolve, all 5 locales at parity
  • Vitest: GeneralPane + AgentsPane suites pass (33 tests)
  • oxlint/oxfmt clean (lint-staged)

Notes

  • i18n keys were renamed by hand (mechanical JSON-key + reference swap across the 5 locale files) — no catalog regeneration needed, since the verifier matches references against en.json rather than deriving keys from filenames.

Made with Orca 🐋


Open in Stage

Additional fix: orphaned Project Runtime header on non-Windows hosts

Found while validating the above in the running app. The General pane's Project Runtime section ("Default runtime for local Windows projects…") rendered its header on macOS/Linux even with no Windows runtime connected, leaving a title + description with no control beneath it.

Cause: the section's render guard relied solely on matchesSettingsSearch, which returns true for an empty search query regardless of the (conditionally empty) entries array — so the platform gate was effectively bypassed when not searching. The inner DefaultWindowsProjectRuntimeSetting self-hides via wslSupportedPlatform, hence the orphaned header.

Fix: gate the section on wslSupportedPlatform directly via a new shouldShowProjectRuntimeSection helper; added regression tests for the empty-query case on non-Windows hosts.

Verified live via CDP on the running dev build: backing data was correct (hostPlatform: darwin, no active runtime env, 0 hosts), and after the fix the orphaned section is gone from the General pane DOM.


Additional change: proxy settings → Advanced, progressive disclosure

The Network/proxy settings sat in General as two always-visible input boxes with help text — heavy visual weight for a low-level setting most users never touch.

Change: moved them to the Advanced pane (alongside HTTP/1.1 Compatibility — same corporate-VPN/proxy audience) under a new Network subsection, and collapsed the inputs behind a single "Configure proxy" disclosure. The fields auto-expand when a proxy is already configured or when a proxy-related settings search matches, so a set value is never hidden behind the collapse.

Renames GeneralNetworkSettingsSection → AdvancedNetworkSettingsSection (component + i18n key path across all 5 locales), moves its search entries into a dedicated advanced-network-search module wired into the Advanced pane search, and relocates the proxy-draft tests.

Verified live via CDP: General no longer shows the proxy boxes; Advanced shows the Network subsection with the collapsed "Configure proxy" trigger, which expands both fields on click.

The prompt cache countdown is a functional cost-awareness control tied to
how Claude agents run, not a general app preference. Move it out of the
cluttered General pane into Agents, next to the idle-related "keep agent
awake" setting, where users look for agent behavior/cost config.

Also drop the redundant "expired" text on the sidebar timer — the red
icon already conveys the state, and the countdown text is only meaningful
while the cache is alive. The tooltip still carries the full explanation.

Renames GeneralCacheTimerSection -> AgentCacheTimerSection (component and
its i18n key path across all 5 locales) and moves its search entry into a
dedicated agent-cache-timer-search module wired into the Agents pane search.

Co-authored-by: Orca <[email protected]>
@ghost

ghost commented Jun 18, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Fix orphaned Project Runtime header on non-Windows
2 Move Network settings from General to Advanced
3 Move Prompt Cache Timer to Agents pane
4 Simplify expired state in sidebar timer
Open in Stage

Chapters generated by Stage for commit a9bb715 on Jun 18, 2026 9:22am UTC.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Prompt Cache Timer setting is moved from the General settings pane to the Agents settings pane. A new agent-cache-timer-search.ts file exports getAgentCacheTimerSearchEntries, which is added to the agents search catalog; the corresponding entry is removed from general-search.ts. The component file is renamed from GeneralCacheTimerSection to AgentCacheTimerSection with its i18n key references updated, and the locale key is renamed from GeneralCacheTimerSection to AgentCacheTimerSection in all five locale files (en, es, ja, ko, zh). GeneralPane drops the section import and its render branch; AgentsPane imports and renders AgentCacheTimerSection after AgentAwakeSetting. A new shouldShowProjectRuntimeSection helper is added to GeneralPane to prevent the Project Runtime section from appearing on non-Windows hosts when the search query would otherwise match. Additionally, CacheTimer.tsx removes the translate import and stops rendering a countdown label when the cache is expired.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely summarizes the two main changes: moving the Prompt Cache Timer setting to the Agents pane and simplifying the expired state indicator.
Description check ✅ Passed The description covers the user-visible changes, testing approach, and includes detailed technical notes about the implementation and platform-specific bug fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

The General pane's Project Runtime section ("Default runtime for local
Windows projects...") rendered its header on macOS/Linux even with no
Windows runtime, leaving a title and description with no control beneath
it (the inner DefaultWindowsProjectRuntimeSetting self-hides).

Cause: the render guard relied on matchesSettingsSearch, which returns
true for an empty search query regardless of the (empty) entries array,
so the platform gate was effectively bypassed when not searching.

Gate the section on wslSupportedPlatform directly via a new
shouldShowProjectRuntimeSection helper, and add regression tests covering
the empty-query case on non-Windows hosts.

Co-authored-by: Orca <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/renderer/src/components/settings/GeneralPane.test.ts (1)

168-186: 💤 Low value

Consider using getGeneralProjectRuntimeSearchEntries() for more precise tests.

The test currently uses getGeneralPaneSearchEntries() (all entries), while the component passes getGeneralProjectRuntimeSearchEntries() (only runtime entries). The test still validates the behavior correctly since earlier tests verify the keyword inclusion, but using the specific runtime entries would more closely mirror production usage and catch regressions if those entries were accidentally modified.

 describe('GeneralPane project runtime section visibility', () => {
-  const entries = getGeneralPaneSearchEntries()
+  // Use the same entries the component passes to shouldShowProjectRuntimeSection
+  const entries = getGeneralProjectRuntimeSearchEntries()

This would require importing getGeneralProjectRuntimeSearchEntries from ./general-search.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 589badde-52c6-47d9-a990-6a7ea5dc8347

📥 Commits

Reviewing files that changed from the base of the PR and between 851927e and 8e4e320.

📒 Files selected for processing (2)
  • src/renderer/src/components/settings/GeneralPane.test.ts
  • src/renderer/src/components/settings/GeneralPane.tsx

The Network/proxy settings sat in General as two always-visible input
boxes with help text — heavy visual weight for a low-level setting most
users never touch. Move them to the Advanced pane (alongside HTTP/1.1
Compatibility, same corporate-VPN/proxy audience) under a new Network
subsection, and collapse the inputs behind a single "Configure proxy"
disclosure.

The fields auto-expand when a proxy is already configured or when a
proxy-related settings search matches, so a set value is never hidden.

Renames GeneralNetworkSettingsSection -> AdvancedNetworkSettingsSection
(component + i18n key path across all 5 locales), moves its search entries
into a dedicated advanced-network-search module wired into the Advanced
pane search, and relocates the proxy-draft tests accordingly.

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@Jinwoo-H
Jinwoo-H merged commit b7d146d into main Jun 18, 2026
1 check passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/prompt-cache-improve branch June 18, 2026 17:25
carlosbaraza added a commit to carlosbaraza/orca that referenced this pull request Jun 18, 2026
* upstream/main: (220 commits)
  Show and Filter Automation-Created Workspaces (stablyai#5697)
  Fix premature project header truncation
  Send review notes to any running agent of a worktree (stablyai#5654)
  Fix workspace sidebar appearance setting (stablyai#5725)
  Highlight the open file in the Source Control sidebar (stablyai#5667)
  release: v1.4.80-rc.1
  Fix premature Codex completion notifications (stablyai#5682)
  Improve Codex startup prompt reliability (stablyai#5686)
  Keep hibernated agent completions visible (stablyai#5689)
  Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691)
  release: v1.4.80-rc.0
  Skip GitHub CLI preflight checks if no GitHub projects exist
  fix: restore font family keyboard navigation in settings
  Update README downloads badge
  fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688)
  Fix nested workspace card indentation (stablyai#5684)
  Fix flaky e2e tests (stablyai#5680)
  Replace plus icon with play button on quick command entry (stablyai#5674)
  Use managed Pi and OMP extensions (stablyai#5681)
  Narrow computer-use e2e trigger (stablyai#5685)
  ...

# Conflicts:
#	mobile/src/terminal/TerminalWebView.tsx
#	mobile/src/terminal/terminal-webview-text-zoom.test.ts
carlosbaraza added a commit to carlosbaraza/orca that referenced this pull request Jun 18, 2026
* upstream/main: (78 commits)
  Show and Filter Automation-Created Workspaces (stablyai#5697)
  Fix premature project header truncation
  Send review notes to any running agent of a worktree (stablyai#5654)
  Fix workspace sidebar appearance setting (stablyai#5725)
  Highlight the open file in the Source Control sidebar (stablyai#5667)
  release: v1.4.80-rc.1
  Fix premature Codex completion notifications (stablyai#5682)
  Improve Codex startup prompt reliability (stablyai#5686)
  Keep hibernated agent completions visible (stablyai#5689)
  Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691)
  release: v1.4.80-rc.0
  Skip GitHub CLI preflight checks if no GitHub projects exist
  fix: restore font family keyboard navigation in settings
  Update README downloads badge
  fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688)
  Fix nested workspace card indentation (stablyai#5684)
  Fix flaky e2e tests (stablyai#5680)
  Replace plus icon with play button on quick command entry (stablyai#5674)
  Use managed Pi and OMP extensions (stablyai#5681)
  Narrow computer-use e2e trigger (stablyai#5685)
  ...

# Conflicts:
#	mobile/app/h/[hostId]/session/[worktreeId].tsx
#	mobile/src/terminal/TerminalWebView.tsx
#	mobile/src/terminal/terminal-webview-html.ts
carlosbaraza added a commit to carlosbaraza/orca that referenced this pull request Jun 18, 2026
* upstream/main: (220 commits)
  Show and Filter Automation-Created Workspaces (stablyai#5697)
  Fix premature project header truncation
  Send review notes to any running agent of a worktree (stablyai#5654)
  Fix workspace sidebar appearance setting (stablyai#5725)
  Highlight the open file in the Source Control sidebar (stablyai#5667)
  release: v1.4.80-rc.1
  Fix premature Codex completion notifications (stablyai#5682)
  Improve Codex startup prompt reliability (stablyai#5686)
  Keep hibernated agent completions visible (stablyai#5689)
  Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691)
  release: v1.4.80-rc.0
  Skip GitHub CLI preflight checks if no GitHub projects exist
  fix: restore font family keyboard navigation in settings
  Update README downloads badge
  fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688)
  Fix nested workspace card indentation (stablyai#5684)
  Fix flaky e2e tests (stablyai#5680)
  Replace plus icon with play button on quick command entry (stablyai#5674)
  Use managed Pi and OMP extensions (stablyai#5681)
  Narrow computer-use e2e trigger (stablyai#5685)
  ...

# Conflicts:
#	src/renderer/src/i18n/locales/en.json
#	src/renderer/src/i18n/locales/es.json
#	src/renderer/src/i18n/locales/ja.json
#	src/renderer/src/i18n/locales/ko.json
#	src/renderer/src/i18n/locales/zh.json
carlosbaraza added a commit to carlosbaraza/orca that referenced this pull request Jun 18, 2026
* upstream/main: (341 commits)
  Show and Filter Automation-Created Workspaces (stablyai#5697)
  Fix premature project header truncation
  Send review notes to any running agent of a worktree (stablyai#5654)
  Fix workspace sidebar appearance setting (stablyai#5725)
  Highlight the open file in the Source Control sidebar (stablyai#5667)
  release: v1.4.80-rc.1
  Fix premature Codex completion notifications (stablyai#5682)
  Improve Codex startup prompt reliability (stablyai#5686)
  Keep hibernated agent completions visible (stablyai#5689)
  Move Prompt Cache Timer setting to Agents pane, simplify expired state (stablyai#5691)
  release: v1.4.80-rc.0
  Skip GitHub CLI preflight checks if no GitHub projects exist
  fix: restore font family keyboard navigation in settings
  Update README downloads badge
  fix(landing): make GitHub CLI setup nudge dismissible and provider-aware (stablyai#5688)
  Fix nested workspace card indentation (stablyai#5684)
  Fix flaky e2e tests (stablyai#5680)
  Replace plus icon with play button on quick command entry (stablyai#5674)
  Use managed Pi and OMP extensions (stablyai#5681)
  Narrow computer-use e2e trigger (stablyai#5685)
  ...

# Conflicts:
#	src/main/text-generation/commit-message-text-generation.test.ts
#	src/main/text-generation/commit-message-text-generation.ts
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant