Skip to content

feat: configurable working-notes & cluster LLM prompts#15

Merged
kastriotkastrati merged 3 commits into
mainfrom
configurable-prompts
Jun 28, 2026
Merged

feat: configurable working-notes & cluster LLM prompts#15
kastriotkastrati merged 3 commits into
mainfrom
configurable-prompts

Conversation

@kastriotkastrati

Copy link
Copy Markdown
Contributor

What

Makes the two LLM summary prompts configurable via env, with verbatim fallback to the current prompts.

  • Working notes (per-thread GitHub sticky comment) → NOTES_PROMPT
  • Cluster summary (cross-thread rollup) → CLUSTER_PROMPT

How

  • System/user split: the configured text is sent as the model's system prompt; the thread data (title/state/description/discussion) stays the user message, assembled in code. Truncation bounds, bot/own-comment exclusion, and output sanitization remain in code and are not overridable.
  • Fallback: unset/blank → built-in DEFAULT_NOTES_PROMPT / DEFAULT_CLUSTER_PROMPT, which are the original prompts verbatim. An unset secret behaves exactly as before.
  • Idempotency: both prompts fold into the notes/cluster content hash, so editing a prompt re-renders existing notes and busts the AI Gateway cache. promptVar maps blank/whitespace env → undefined so an empty prompt is unrepresentable (schema .min(1).default(...)).

Updating in production

Cloudflare secrets, no redeploy (takes effect next event):

cd apps/worker
wrangler secret put NOTES_PROMPT < notes-prompt.txt
wrangler secret put CLUSTER_PROMPT < cluster-prompt.txt

See docs/configuring-prompts.md.

Verification

typecheck 13/13 · test 13/13 · lint clean (incl. no-raw-loops). Merged latest main (raw-loop refactor) into the branch.

Add NOTES_PROMPT / CLUSTER_PROMPT env overrides, sent as the model's
system prompt; thread data stays the user message. Unset/blank falls back
to the original prompts (DEFAULT_NOTES_PROMPT / DEFAULT_CLUSTER_PROMPT).
Both prompts fold into the notes/cluster content hash so a prompt change
re-renders. Adds docs/configuring-prompts.md.
# Conflicts:
#	packages/core/src/clusters.test.ts
# Conflicts:
#	apps/worker/src/context.ts
#	packages/core/src/clusters.ts
#	packages/core/src/notes.ts
#	packages/core/src/pipeline.ts
@kastriotkastrati kastriotkastrati merged commit dfc8f99 into main Jun 28, 2026
1 check 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.

1 participant