Skip to content

Fix code example accuracy issues in part6, part7, and part11#4

Closed
OnlyTerp wants to merge 1 commit into
mainfrom
devin/1776314352-validate-code-examples
Closed

Fix code example accuracy issues in part6, part7, and part11#4
OnlyTerp wants to merge 1 commit into
mainfrom
devin/1776314352-validate-code-examples

Conversation

@OnlyTerp

Copy link
Copy Markdown
Owner

Summary

Three small fixes to code examples across the guide to improve accuracy and reproducibility:

  1. part6-context-compression.md — The "fixed" compression error-handler used return original_context, which introduces an undefined variable and switches from the assignment pattern used in the "broken" example (compressed_context = ""). Changed to compressed_context = messages_to_compress so both examples use consistent control flow and reference only variables visible in the snippet.

  2. part7-memory-system.md — Removed the "No API calls" claim. session_search with a query can use an auxiliary LLM for summarization (documented in Part 9's auxiliary models table), so the blanket "no API calls" statement was inaccurate. Added a parenthetical cross-reference to Part 9.

  3. part11-gateway-recovery.md — Health check script used df -h which can produce multi-line output per filesystem when device names are long, breaking the awk 'NR==2' extraction. Changed to df -Ph (POSIX format) to guarantee one line per filesystem.

Review & Testing Checklist for Human

  • part6 fix — type semantics: The broken example assigns a string ("") to compressed_context, and the fix now assigns messages_to_compress (likely a list of message objects, not a string). Verify this is the intended illustration — an alternative would be to keep the return early-exit pattern but use a defined variable, or to add a brief comment noting the type difference.
  • part7 wording: Confirm the parenthetical about session_search using an auxiliary LLM is accurate per your understanding of Hermes internals. The claim is based on Part 9's auxiliary model config.

Notes

  • part10-soul-antipatterns.md was reviewed and contains no executable code examples (only markdown SOUL.md content blocks) — no changes needed.
  • All changes are documentation-only; no functional code is affected.

Link to Devin session: https://app.devin.ai/sessions/2066c5f4b697452a853a925a9a19d7a3
Requested by: @OnlyTerp

- part6: Fix inconsistent control flow in compression fix example —
  use assignment (compressed_context = messages_to_compress) to match
  broken example's pattern instead of returning undefined variable
- part7: Remove inaccurate 'No API calls' claim — session_search
  with queries uses an auxiliary LLM for summarization (see Part 9)
- part11: Use df -Ph instead of df -h in health check script for
  reliable POSIX single-line-per-filesystem output

Co-Authored-By: Rob <onerobby@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

OnlyTerp added a commit that referenced this pull request May 27, 2026
Re-applies the valid parts of #4: part6 compression fallback assigns compressed_context = messages_to_compress instead of returning undefined original_context; part11 gateway health check uses df -Ph so awk NR==2 is stable. Does not apply #4's part7 change because current Hermes source tools/session_search_tool.py explicitly documents no LLM calls / no summary LLM path. Supersedes #4.
@OnlyTerp

Copy link
Copy Markdown
Owner Author

Handled the good parts. Re-applied the part6 and part11 fixes on top of current main and merged them as #16.

I did not apply the part7 wording change. Current Hermes source () explicitly documents as no LLM calls / no summary LLM path, so the existing no-API-call wording is accurate for the current codebase. Closing this PR in favor of #16.

@OnlyTerp

Copy link
Copy Markdown
Owner Author

Superseded by #16, which merged the two valid fixes from this PR. The part7 change was intentionally left out because current Hermes source says session_search makes no LLM calls / no summary LLM path.

@OnlyTerp OnlyTerp closed this May 27, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@OnlyTerp

Copy link
Copy Markdown
Owner Author

Clean note after close: #16 superseded this PR and merged the two valid code-example fixes:

  • part6-context-compression.md: avoid returning undefined original_context; assign compressed_context = messages_to_compress.
  • part11-gateway-recovery.md: use df -Ph so the awk 'NR==2' extraction is stable.

The part7-memory-system.md change was intentionally left out because current Hermes source (tools/session_search_tool.py) explicitly documents that session_search makes no LLM calls and has no summary LLM path, so the no-API-call wording is accurate for the current codebase.

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