Skip to content

Feature/stab fixes sessions flows#12

Merged
roxblnfk merged 6 commits into
mainfrom
feature/stab-fixes-sessions-flows
Sep 16, 2025
Merged

Feature/stab fixes sessions flows#12
roxblnfk merged 6 commits into
mainfrom
feature/stab-fixes-sessions-flows

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Sep 15, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and bug fixes to the Claude and OpenAI mappers, as well as updates to the Stream module documentation. The most significant changes include stricter tool ID sanitization and handling for Claude integration, improved merging logic for developer messages, a more robust approach to empty function call arguments in the OpenAI mapper, and a comprehensive rewrite of the Stream module's documentation to clarify its API and behavior.

Claude Mapper Improvements:

  • Added a sanitize_tool_id function to enforce Claude's tool ID format and applied it wherever tool IDs are set or read, preventing invalid tool IDs from causing errors. [1] [2] [3] [4] [5]
  • Improved merging logic for developer messages: now, if the previous message is a tool result or if there are no previous messages, a new user message is created instead of merging, ensuring correct message sequencing.

OpenAI Mapper Fixes:

  • Fixed an issue where empty function call arguments would serialize as {} by replacing them with { invoke = true }, ensuring downstream compatibility.
  • Adjusted prompt token calculation to subtract cached tokens, providing more accurate token usage reporting.

Documentation Updates:

  • Completely rewrote the Stream module documentation to clarify its API, including chunk-based and token-based reading, scanner lifecycle, async behavior, error handling, and best practices. This makes the module's usage and expected behaviors much clearer for developers. [1] [2]

Minor/Other:

  • Added retrieval of the from PID in the message processing spec for completeness.
  • Removed extraneous newlines and minor formatting tweaks in the OpenAI mapper for code cleanliness. [1] [2] [3] [4] [5]

@wolfy-j wolfy-j requested a review from roxblnfk September 15, 2025 20:24
@roxblnfk roxblnfk merged commit fa44d5d into main Sep 16, 2025
@roxblnfk roxblnfk deleted the feature/stab-fixes-sessions-flows branch September 16, 2025 05:38
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