Skip to content

translate: teach both backends in the grammar prompt, default to memory#22

Merged
vinodhalaharvi merged 1 commit into
mainfrom
claude/prompt-teach-memory
May 25, 2026
Merged

translate: teach both backends in the grammar prompt, default to memory#22
vinodhalaharvi merged 1 commit into
mainfrom
claude/prompt-teach-memory

Conversation

@vinodhalaharvi-claude
Copy link
Copy Markdown
Collaborator

The bug (this is what you just hit in Slack)

You typed 'run in memory: summarize ...' and loom replied 'known action but not available on this backend yet.' That's the temporal not-implemented error — meaning the LLM emitted temporal static ( summarize ... ) despite you saying in memory.

Root cause: BuildPrompt hardcoded temporal static ( ... ) as the only block form and literally said 'Output exactly one block: temporal static'. The LLM was never told memory exists, so it always picked temporal — where summarize isn't implemented → rejected. The prompt made your request impossible. Not a loom bug; loom routes memory correctly.

Fix (BuildPrompt)

  • Teach both block forms: memory static ( ... ) (in-process, immediate) and temporal static ( ... ) (durable)
  • CHOOSING THE BACKEND section: default to memory for research/summarize/read/ask/analyze/almost everything; temporal only when durability is explicitly requested; 'in memory'/'locally'/'quickly' → memory
  • Examples now show memory blocks (summarize; parallel research → merge → ask) + one explicit temporal example

Effect

@loom run in memory: summarize ...memory static ( summarize ... ) → loom routes to in-process execution (Claude Code) → result posts back. The full in-memory verb set is now reachable from Slack prose.

Test

prompt_backend_test.go: prompt must contain both block forms, the memory DEFAULT, and the 'in memory' cue — regression guard.

Step Result
vet / gofmt / staticcheck
go test -race ./pkg/script/...
build

The prompt hardcoded 'temporal static ( ... )' as the only block form and
instructed 'Output exactly one block: temporal static'. So the LLM ALWAYS
emitted temporal — even when the user said 'in memory'. A memory-only
verb (summarize, search, ...) then landed on temporal and was rejected
with 'known action but not available on this backend yet'. The user asked
for memory; the prompt made it impossible.

Fix (BuildPrompt):
  - Teach BOTH block forms: 'memory static ( ... )' and
    'temporal static ( ... )', with one-line semantics (memory = runs
    in-process immediately; temporal = durable workflow).
  - Add a CHOOSING THE BACKEND section: default to memory for research /
    summarize / read / ask / analyze / almost everything; use temporal
    ONLY when durability/scheduling/background is explicitly requested
    (and note only echo runs on temporal today); 'in memory' / 'locally'
    / 'quickly' → memory.
  - Examples now show memory blocks (summarize, parallel research+merge+
    ask) plus one explicit temporal example.

Effect: 'run in memory: summarize ...' now translates to
'memory static ( summarize ... )' → loom routes it to in-process
execution (Claude Code) → result posts back, instead of being rejected.
The full in-memory verb set becomes reachable from prose.

Test (prompt_backend_test.go): the prompt must contain both block forms,
the memory DEFAULT, and the 'in memory' cue — regression guard against
reverting to temporal-only.

CI: vet, gofmt, staticcheck, go test -race ./pkg/script/..., build pass.
@vinodhalaharvi vinodhalaharvi merged commit ff5b4b8 into main May 25, 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.

2 participants