Skip to content

Fix solve-loop feedback and LLM errors; add --debug and README - #7

Open
Artemyogo wants to merge 1 commit into
revert/code-fixesfrom
fix/solve-loop
Open

Artemyogo wants to merge 1 commit into
revert/code-fixesfrom
fix/solve-loop

Conversation

@Artemyogo

Copy link
Copy Markdown
Contributor

Copy of #4 (code changes only; the README parts of #4 are already in main). Based on #6: merge #6 first, then this PR will be pointed at main.

Summary

Follow-up to #3. Fixes several bugs that stopped the model from getting useful feedback in the solve loop (it went in circles on skretka), adds a --debug flag, and replaces the temporary README.

Feedback to the model

  • Send real g++ errors instead of "see stderr above"
  • Apply compiler flags on every build (they were never used, and were missing their dashes)
  • Report crash signals (e.g. SIGSEGV) for runtime errors
  • Run secret tests only after public tests pass, so the model sees the public failure instead of "This test is secret"
  • Set Ollama num_ctx (default 12288): Ollama's 4096 default was silently cutting the start of the conversation, including the problem statement

LLM clients

  • Raise clear errors on request failures instead of returning None (which crashed later); add a request timeout
  • Gemini: send the full conversation and system instruction; switch retired gemini-2.0-flash → gemini-3.8-flash
  • Extract code from replies properly (<think> blocks, prose, markdown fences) instead of .strip("cpp")`
  • Pass the think setting through

Other

  • --debug prints every prompt sent to the LLM
  • Skip missing tests_secret folders with a warning
  • config_manager.py switch now actually changes the profile used
  • New README: how it works, Docker quick start (Ollama/Gemini), options, problem format, configuration

Note

With -Werror now applied, compiler warnings fail the build. The model sees them and can fix them, but may need more attempts.

Testing

  • Each fix checked in the container: code extraction cases, -Werror=shadow error reaches the message, SIGSEGV reported, unreachable server gives one clear error, Gemini request format validated, missing secret tests skipped, profile switching
  • resources/factorial solved by qwen3:14b on the first attempt
  • Gemini: key accepted, but runs returned 503 (Google overloaded), so a full Gemini run is not yet verified
  • skretka not yet rerun with all fixes

🤖 Generated with Claude Code

- Send real g++ errors to the model instead of "see stderr above"
- Apply compiler flags on every build and add the missing dashes
- Report crash signals (e.g. SIGSEGV) for runtime errors
- Run secret tests only after public tests pass, so the model sees the
  visible failure instead of "This test is secret"
- Extract code from replies properly (<think> blocks, prose, fences)
- Raise clear errors on LLM request failures instead of returning None;
  add a request timeout
- Send full conversation and system instruction to Gemini; switch the
  retired gemini-2.0-flash to gemini-3.8-flash
- Set Ollama num_ctx (default 12288) so long conversations are not
  silently truncated; pass the think setting through
- Skip missing secret test folders with a warning
- Respect active_profile from settings.json (config_manager switch)
- Add --debug to print every prompt sent to the LLM
- Print panels as plain text so code brackets aren't parsed as markup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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