Skip to content

feat: add REPL hints for LLMs using FINAL_VAR#77

Merged
alexzhang13 merged 1 commit intoalexzhang13:mainfrom
rawwerks:feature/repl-llm-hints
Feb 1, 2026
Merged

feat: add REPL hints for LLMs using FINAL_VAR#77
alexzhang13 merged 1 commit intoalexzhang13:mainfrom
rawwerks:feature/repl-llm-hints

Conversation

@rawwerks
Copy link
Contributor

Summary

Some models need help understanding the REPL interaction pattern. This adds hints that guide LLMs to use FINAL_VAR for returning results.

Test results with gemini-3-flash-preview:

  • Before hints: 1/3 success (2 failed with "Variable not found")
  • After hints: 4/4 success

Context

Discussion: https://x.com/raw_works/status/2016515555088322858

Test plan

  • Tested with gemini-3-flash-preview (4/4 success after change)
  • Verify no regression with other models

🤖 Generated with Claude Code

- Improved FINAL_VAR error messages to show available variables
  and explain that variables must be created before use
- Added SHOW_VARS() helper function to all REPL environments
- Updated system prompt with WARNING section about common mistake
- Documented SHOW_VARS() in REPL initialization instructions

This helps weaker LLMs (like gemini-3-flash-preview) avoid the
common mistake of calling FINAL_VAR before creating the variable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@alexzhang13 alexzhang13 merged commit 37f6d0b into alexzhang13:main Feb 1, 2026
3 checks passed
@rawwerks
Copy link
Contributor Author

rawwerks commented Feb 2, 2026

woot!

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