Skip to content

feat(cache): stable prompt prefix and cache accounting (M3) - #4

Closed
lutfi-haslab wants to merge 1 commit into
feat/harness-v3-m1from
feat/harness-v3-m3
Closed

lutfi-haslab wants to merge 1 commit into
feat/harness-v3-m1from
feat/harness-v3-m3

Conversation

@lutfi-haslab

Copy link
Copy Markdown
Contributor

Milestone 3 (stacked on #3).

  • Stable system prefix + volatile trailing system-reminder (git status, budget, todos, notifications, summary).
  • No per-step transcript sliding; large-chunk windowing only on context overflow.
  • Deterministic prompt assembly (tools, plugins, summary files).
  • Cache accounting: stream_options.include_usage, OpenAI cached_tokens, Anthropic cache_read/cache_creation, DeepSeek hit/miss; normalized and no double counting.
  • Anthropic 4 breakpoints; OpenAI prompt_cache_key; Zhipu/GLM providers.
  • TUI transcript hydration and colored unified diffs.

Tests: cache breakpoints, normalization, retry, diff rendering. go test ./... passes.

- split the system prompt into a stable prefix and a volatile trailing
  <system-reminder> (git status, budget, todos, notifications, summaries)
- stop sliding the transcript window per step; cut in large chunks only on
  context overflow
- deterministic prompt assembly: sorted plugin prompts and summary files
- stream_options.include_usage; parse OpenAI cached_tokens, Anthropic
  cache_read/cache_creation and DeepSeek prompt_cache_hit tokens; normalize
  into CachedTokens (and stop double counting)
- Anthropic: four cache breakpoints (tools, system, previous tail, current tail)
- OpenAI prompt_cache_key; add Zhipu/GLM providers
- TUI: hydrate transcript from session history, render colored unified diffs
- tests: cache breakpoints, normalization, retry, diff rendering

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
@lutfi-haslab

Copy link
Copy Markdown
Contributor Author

Merged directly into main via fast-forward (58fdf15). Closing this stacked PR.

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.

2 participants