feat(openclaw): add typed synopsis stubs for externalized tool results#2248
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
87967b4 to
11bfe18
Compare
|
cc @100yenadmin |
|
Hi @100yenadmin, I really like lossless-claw’s approach to keeping large tool outputs recoverable while avoiding dumping the full payload back into the active context. The This PR is inspired by that pattern. OpenViking already had a basic large tool-output externalization / preview path, and this PR builds on it by adding a typed / deterministic synopsis for session tool results: large outputs stay recoverable, while the active context gets a compact typed stub plus read/search/list drilldown. If you have time, I’d really appreciate a quick design sanity check, especially on whether the typed synopsis choices feel reasonable and aligned with a recoverable stub + drilldown model. Thanks again for the inspiration. |
Description
Add typed Tool Stub support for externalized tool results. This keeps OpenViking's existing externalization and ref-based recall flow, while replacing simple head/tail previews with deterministic, type-aware summaries.
This design is inspired by LCM/lossless-claw's tool stubbing approach, adapted to OpenViking's OpenClaw integration and session storage model with deterministic typed synopsis generation and ref-based drilldown rather than LLM summarization.
Related Issue
N/A
Type of Change
Changes Made
json,csv,tsv,yaml,xml,code,text, andunknown.read/search/listexploration hints.docs/design/tool-stub-design.mddocumenting the Tool Stub behavior and current boundaries.Testing
Test command run in a clean worktree:
python -m pytest tests/session/test_tool_result_synopsis.py tests/session/test_tool_result_externalization.py tests/server/test_api_sessions.py::test_tool_result_externalization_read_and_search -q --no-covResult:
29 passed, 4 warningsThe warnings are existing Pydantic deprecation warnings from the current dependency stack.
Checklist
Screenshots (if applicable)
N/A
Additional Notes
This PR intentionally does not add LLM summarization. The current implementation is deterministic and rule-based only.