Skip to content

refactor: remove dynamic content from system prompt for better prefix caching#778

Merged
FL4TLiN3 merged 1 commit intomainfrom
refactor/static-environment-section
Mar 13, 2026
Merged

refactor: remove dynamic content from system prompt for better prefix caching#778
FL4TLiN3 merged 1 commit intomainfrom
refactor/static-environment-section

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • Remove Current time and Working directory from the system prompt environment section — both can be obtained via tool execution (date, pwd)
  • Replace with static OS platform info (os.platform(), os.release(), os.arch()) which is actually useful for knowing the execution environment
  • Remove startedAt parameter from createInstructionMessage and related functions since it's no longer needed

This makes the system prompt fully static, enabling cross-run prefix caching on providers that support it (Fireworks, Anthropic, etc.).

Test plan

  • bun run test passes
  • bun run validate:changeset passes
  • bun run typecheck passes (only pre-existing @perstack/log errors)

🤖 Generated with Claude Code

… caching

Replace current time and working directory in the environment section
with static OS platform info (os.platform/release/arch). Current time
and working directory can be obtained via tool execution, and their
presence in the system prompt broke prefix caching across runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 merged commit b8c7111 into main Mar 13, 2026
11 checks passed
@FL4TLiN3 FL4TLiN3 deleted the refactor/static-environment-section branch March 13, 2026 18:57
@FL4TLiN3 FL4TLiN3 mentioned this pull request Mar 13, 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