GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(muse-proxy): alias shell tools on the /v1/responses passthrough (#2764 follow-up) by dezren39 · Pull Request #2765 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: d2b04fc9f4
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const restoreFnCallNames = (container) => { | ||
| if (!container || typeof container !== 'object') return; | ||
| if (container.type === 'function_call' && container.name) { | ||
| container.name = clientToolName(container.name); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Restore only aliases applied to the current request
When a client defines a tool named terminal or run_command, the outbound request preserves that name, but this unconditional reverse mapping changes its returned function calls to bash or shell. This also defeats the outbound collision guard when both original and alias names are defined, potentially dispatching the wrong tool. Track the aliases actually applied to each request and use only that request-local mapping when restoring buffered responses and SSE events.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| while ((idx = buf.indexOf('\n\n')) >= 0) { | ||
| res.write(restoreEventBlock(buf.slice(0, idx)) + '\n\n'); | ||
| buf = buf.slice(idx + 2); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Recognize CRLF-delimited SSE events before buffering further
If upstream sends SSE events with CRLF line endings, the event separator is \r\n\r\n, so this search never finds a boundary. Unlike the previous streaming passthrough, the proxy buffers the entire response until upstream closes, withholding all incremental output and potentially triggering client idle timeouts during long generations. Recognize CRLF boundaries as well as LF boundaries, including separators split across reads.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const next = directToolAlias(holder.name, taken); | ||
| if (next !== holder.name) { holder.name = next; changed = true; } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Exclude inherited properties from outbound alias lookups
On native Responses requests containing a function named constructor, toString, or __proto__, this newly added aliasing step corrupts the tool definition even though none of those names is a configured alias. directToolAlias indexes a normal object without checking ownership, so it returns inherited functions or objects; assigning that result here makes serialization omit the tool name or emit name: {}. These requests previously passed through unchanged and now reach upstream with invalid definitions. Require an own-property match in the alias table before replacing a name.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Superseded by #2766, which landed the same passthrough aliasing in parallel (outbound tool/history/tool_choice rename, inbound restore for JSON + SSE, byte-for-byte otherwise) while this PR sat in GitHub's merge outage. Closing in its favor; the laptop verification of the combined state is being reported on #2753. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.