Skip to content

feat: inline image detection and tool result string format fix#355

Merged
jalehman merged 2 commits into
Martian-Engineering:mainfrom
LanicBlue:feat/unified-image-and-heartbeat-fix
Apr 11, 2026
Merged

feat: inline image detection and tool result string format fix#355
jalehman merged 2 commits into
Martian-Engineering:mainfrom
LanicBlue:feat/unified-image-and-heartbeat-fix

Conversation

@LanicBlue

Copy link
Copy Markdown
Contributor

Summary

  • Unified inline image detection: Detect and externalize base64 image data (JPEG, PNG, GIF, WebP, SVG) embedded in messages of any role (user/tool/assistant). Images are saved as binary files. Handles both OpenClaw's [media attached:] user pattern and pure base64 payloads in any message content. Image detection is a standalone system independent of the large file text pipeline.
  • String format fix for tool results: Normalize string-format tool result content to array format before processing, ensuring large string tool outputs are properly externalized instead of silently skipped.

Test plan

  • Verify user image attachments are externalized and saved as valid binary files
  • Verify tool results containing base64 image data are externalized
  • Verify string-format tool results with large outputs are properly externalized
  • Run existing test suite to confirm no regressions

🤖 Generated with Claude Code

@jalehman jalehman self-assigned this Apr 10, 2026
Lanic and others added 2 commits April 11, 2026 15:53
1. Detect and externalize base64 image data (JPEG, PNG, GIF, WebP, SVG)
   in messages of any role (user/tool/assistant). Images are saved as
   binary files. Handles both OpenClaw "[media attached:]" user pattern
   and pure base64 payloads in any message content.

2. Normalize string-format tool result content to array before processing
   so large string tool outputs are properly externalized.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Route externalized payloads through a shared large-files directory, add
largeFilesDir/LCM_LARGE_FILES_DIR to the config surface, and prevent
already-externalized image references from being re-routed through the
generic large tool-result text externalizer.

Add focused regressions for inline image storage, structured tool-result
image payloads, string-content tool-result image payloads, and the new
config resolution path. Sync the plugin schema, docs, skill reference,
and add a changeset for the user-visible behavior.

Regeneration-Prompt: |
  Address the PR review findings on inline image externalization in
  lossless-claw. Keep the change additive and local: preserve the
  existing large tool-result externalization behavior for real text
  payloads, but stop tool-result image references from being
  externalized a second time as .txt files. Make tool-message image
  detection operate on the original message shape so structured
  tool_result/function_call_output payloads still round-trip through
  message_parts and assembly. Also stop hard-coding the large-files
  storage location by introducing a configurable largeFilesDir with an
  LCM_LARGE_FILES_DIR env override, then sync the manifest, docs, skill
  reference, tests, and release notes entry so the new storage behavior
  is fully documented.
@jalehman jalehman force-pushed the feat/unified-image-and-heartbeat-fix branch from 6e37c1b to 3e60bdd Compare April 11, 2026 22:55
@jalehman jalehman merged commit 6e9388c into Martian-Engineering:main Apr 11, 2026
1 check passed
@jalehman

Copy link
Copy Markdown
Contributor

Thank you!

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