Skip to content

Conversation

@shegx01
Copy link
Collaborator

@shegx01 shegx01 commented Dec 12, 2025

The OpenAPI compatibility does not support all models (Anthropic models) and native API implementation is needed.
This adapter uses converse API for model's response consistency.

@shegx01 shegx01 self-assigned this Dec 12, 2025
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this file be ignored??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be ignored by default. I'll make the change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed it. It seems that the json file was there before thus marked deleted

Copy link

@pxp9 pxp9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

{value, rest}

_ ->
{nil, rest}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For any other type, you currently return {nil, rest} without consuming the value bytes.

Example: <<name_len, "foo", type=1, AA, BB, CC, ...>>
 After reading name and type, rest = <<AA, BB, CC, ...>>.

This is then recursed with this same rest, so AA is wrongly treated as the next header's name_length. This could desync the parser and can cause MatchError or corrupted headers.

To be correct, unknown types must either be fully parsed/skipped or cause a fail-fast error, not silently ignored.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! You're right — the original _ -> {nil, rest} clause didn't consume the value bytes, which would desync the parser for any non-string (7) header.
Fixed by explicitly handling all AWS Event Stream header types (0-9), consuming the correct number of bytes for each type.

Copy link

@0xSSDD 0xSSDD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

4 participants