refactor: unify agent history and harden runtime diagnostics

Preserve user guidance through history compression, stabilize Flash index targets, and retire withdrawn checks without applying stale verdicts.

Improve runtime diagnostics, tool responses, and history rendering. Simplify documentation and comments.

Validation: 2076 tests passed in the full suite; 381 affected tests and 26 frontend tests passed after cleanup. Ruff and the quality ratchet passed.
This commit is contained in:
somew1nd committed 2026-09-09 21:35:40 -07:00
1 parent e983180b5b
commit 5d92939d91
127 files changed
+13738 -1988

No files matched your search

+6 -5
View File
@@ -376,17 +376,18 @@ def format_read_note_success(
start_line: int | None = None,
end_line: int | None = None,
) -> str:
"""Formats the success message for reading a note."""
range_str = ""
"""The read result: a one-line header naming the note and its extent, then the content."""
if start_line is not None or end_line is not None:
range_str = f" (lines {start_line or 1} to {end_line or 'end'})"
return f"Successfully read note '{key}'{range_str}. '{key}' note content:\n{content}"
extent = f"lines {start_line or 1} to {end_line or 'end'}"
else:
extent = f"{len(content.splitlines())} lines"
return f"Note '{key}' ({extent}):\n{content}"
def format_read_note_failure(key: str, error: str) -> str:
"""Formats the failure message for reading a note."""
if "not found" in error.lower():
return ToolFailure(f"Note '{key}' not found in scratchpad.")
return ToolFailure(f"Note '{key}' not found. Use list_notes to see the saved keys.")
return ToolFailure(f"Failed to read note '{key}': {error}")