Skip to content

✨ feat(models): implement external payload storage for RunInboxMessage#772

Open
claude[bot] wants to merge 1 commit intomainfrom
assistant/features-20260315-073230
Open

✨ feat(models): implement external payload storage for RunInboxMessage#772
claude[bot] wants to merge 1 commit intomainfrom
assistant/features-20260315-073230

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 15, 2026

Summary

Implements external payload storage for RunInboxMessage to support large message payloads without database bloat. The payload_ref field already existed in the data model but loading logic was not implemented (TODO comment at line 348).

Changes

  • src/nodetool/models/run_inbox_message.py:

    • Made get_payload() async to support external storage loading
    • Added imports for json, io, and maybe_scope
    • Implemented external payload loading using ResourceScope.get_temp_storage()
    • Added proper error handling for missing ResourceScope or storage
  • tests/workflows/test_state_tables_refactor.py:

    • Updated existing test to use await msg1.get_payload()
    • Added test_external_payload_storage() to test external storage loading
    • Added test_external_payload_no_scope_error() to test error handling
  • .github/opencode-memory/features.md:

    • Added documentation for the new external payload storage feature

Test Plan

  • All 6 tests in TestRunInboxMessage passed
  • Type checks passed for modified files
  • Lint checks passed for modified files
  • External payload storage loading works correctly
  • Error handling for missing ResourceScope works correctly

Benefits

  • Enables efficient handling of large messages without database bloat
  • Maintains transparent access via get_payload() method
  • Supports all storage backends (S3, file storage, memory storage, etc.)

🤖 Generated with Claude Code

Implement the TODO comment at line 348 to support loading large message
payloads from external storage. The payload_ref field already existed in
the data model but loading logic was not implemented.

Changes:
- Make get_payload() async to support external storage loading
- Add imports for json, io, and maybe_scope
- Implement external payload loading using ResourceScope.get_temp_storage()
- Add proper error handling for missing ResourceScope or storage
- Update test to use await msg1.get_payload()
- Add tests for external payload storage functionality
- Update features.md to document the new feature

Files:
- src/nodetool/models/run_inbox_message.py
- tests/workflows/test_state_tables_refactor.py
- .github/opencode-memory/features.md

Co-Authored-By: Claude Sonnet 4.6 <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.

0 participants