Skip to content

0.1.83: request 1-hour prompt cache (token fix), context chip above prompt box - #99

Merged
pathscale merged 1 commit into
fix/worktable-beta5from
fix/chip-above-and-red-dot
Aug 5, 2026
Merged

pathscale merged 1 commit into
fix/worktable-beta5from
fix/chip-above-and-red-dot

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Token cost: request the 1-hour prompt cache

The app set no cache TTL, so on API-key auth Claude defaults to the 5-minute cache. In a long conversation with minutes between turns, the cache dies between turns and every turn re-bills the entire history at full input price instead of the 0.1× cache read.

Set ENABLE_PROMPT_CACHING_1H=1 on Claude runs. The CLI exposes no per-request TTL flag — this env var is the only lever (same mechanism the abstraction uses for MAX_THINKING_TOKENS). Cache reads refresh the window for free, so an active session rarely pays the higher 1h write more than once. No-op on subscription auth (the CLI already requests 1h there).

Stacks on #98 (static system prompt → cacheable). Together: the history is written to cache once and read at 0.1× for up to an hour, instead of re-billed in full every turn.

UI: context chip above the prompt box

Moved from an in-box top-right corner chip (which overlapped text while typing a long line) to its own right-aligned row above the prompt box.

Verify

  • cargo test -p az-gui — 130 pass, fmt/clippy clean
  • bun run typecheck + biome check clean, bun run test:run — 318 pass
  • After merge, confirm on a continuing conversation: cache-read tokens should stay high across replies minutes apart (the 5m cache would have gone cold); the "cache miss?" chip should stop appearing.

Token cost: the app set no cache TTL, so on API-key auth Claude defaulted
to the 5-minute cache. In a long conversation with minutes between turns
the cache dies between turns and every turn re-bills the whole history at
full input price instead of the 0.1x cache read. Set
ENABLE_PROMPT_CACHING_1H=1 on Claude runs (the CLI exposes no per-request
TTL flag; this env var is the only lever). Cache reads refresh the window
for free, so an active session rarely pays the higher 1h write more than
once. A no-op on subscription auth, where the CLI already requests 1h.

UI: the context readout moves to its own row above the prompt box,
right-aligned, so a long sentence being typed never runs under it. It was
an in-box corner chip that overlapped the text.

Bump to 0.1.83.
@pathscale
pathscale force-pushed the fix/chip-above-and-red-dot branch from 1c97bf0 to 8bee371 Compare August 5, 2026 01:51
@pathscale
pathscale changed the base branch from master to fix/worktable-beta5 August 5, 2026 01:51
@pathscale
pathscale merged commit 53c7f1a into fix/worktable-beta5 Aug 5, 2026
2 checks passed
@pathscale
pathscale deleted the fix/chip-above-and-red-dot branch August 5, 2026 01:52
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