Skip to content

Rework system-prompt cache identity and /prompt-show output`#509

Merged
ericdallo merged 1 commit into
masterfrom
rework-system-prompt-handling
Jun 19, 2026
Merged

Rework system-prompt cache identity and /prompt-show output`#509
ericdallo merged 1 commit into
masterfrom
rework-system-prompt-handling

Conversation

@zikajk

@zikajk zikajk commented Jun 19, 2026

Copy link
Copy Markdown
Member

The static prompt cache was keyed only on agent+model, so adding or removing file contexts silently reused stale instructions. Introduce a SHA-256 signature over all inputs that affect static prompt rendering (contexts, rules, skills, tools, environment, chat-prompt template); repo-map content is represented by presence only to avoid running git ls-files on every cache hit.

Consolidate SHA-256 helpers into eca.digest and reuse in cache.clj and oauth.clj. Quote-safe attribute rendering replaces ad-hoc string formatting in context/rule/skill XML tags.

/prompt-show is now read-only: it no longer consumes the editor-state cursor, and its output is reorganized into clearly delimited sections (Instructions / Chat) matching what the model receives. Fix a double blank line before ## MCP Resources caused by a trailing separator leaking when the Context section is absent.

  • I added a entry in changelog under unreleased section.
  • This is not an AI slop.

The static prompt cache was keyed only on agent+model, so adding or
removing file contexts silently reused stale instructions.
Introduce a SHA-256 signature over all inputs that affect static prompt
rendering (contexts, rules, skills, tools, environment, chat-prompt
template); repo-map content is represented by presence only to avoid
running `git ls-files` on every cache hit.

Consolidate SHA-256 helpers into eca.digest and reuse in cache.clj and
oauth.clj. Quote-safe attribute rendering replaces ad-hoc string
formatting in context/rule/skill XML tags.

/prompt-show is now read-only: it no longer consumes the editor-state
cursor, and its output is reorganized into clearly delimited sections
(Instructions / Chat) matching what the model receives. Fix a double
blank line before ## MCP Resources caused by a trailing separator
leaking when the Context section is absent.
@zikajk zikajk force-pushed the rework-system-prompt-handling branch from 24ab2d2 to 262963d Compare June 19, 2026 17:52

@ericdallo ericdallo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thank you!

@ericdallo ericdallo merged commit fe293ba into master Jun 19, 2026
9 checks passed
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