Skip to content

fix: resolve 6 verified bugs across SDK, evaluation, and examples#167

Open
Ricardo-M-L wants to merge 1 commit intoagent-infra:mainfrom
Ricardo-M-L:fix/multiple-bug-fixes
Open

fix: resolve 6 verified bugs across SDK, evaluation, and examples#167
Ricardo-M-L wants to merge 1 commit intoagent-infra:mainfrom
Ricardo-M-L:fix/multiple-bug-fixes

Conversation

@Ricardo-M-L
Copy link
Copy Markdown

Summary

Fixes #134 and 5 additional verified bugs found through source code review.

  • Bug 1 (Fixes [BUG] incorrect url joining when there are other query params in baseUrl #134): createRequestUrl produced double ? when baseUrl already contained query parameters — now uses & separator when ? is already present
  • Bug 2: Agent loop max_iterations fallback returned messages[-1] which could be a tool response instead of an assistant message — now searches backwards for the last assistant message in both AzureOpenAIAgentLoop and OpenAIAgentLoop
  • Bug 3: Volcengine createSandbox/listSandboxes spread ...kwargs[0] on top of already-mapped PascalCase fields, producing duplicate camelCase+PascalCase keys in JSON body — removed redundant spread
  • Bug 4: All Volcengine catch blocks silently swallowed errors via return error instead of rethrowing — changed to throw error so callers can handle failures properly
  • Bug 5: site-to-markdown example injected raw HTML into f-string with triple quotes, allowing code injection if HTML contained ''' — now base64-encodes HTML and decodes inside the sandbox
  • Bug 6: browser-use-cua example had duplicate imports (asyncio, os), duplicate Tools() instantiation, and duplicate __main__ block — cleaned up to single definitions

Test plan

  • Added unit tests for createRequestUrl (7 tests) — all passing
  • Added unit tests for Volcengine createSandbox/listSandboxes duplicate key prevention (2 tests) — all passing
  • Added unit tests for Volcengine error rethrowing across all 5 methods (5 tests) — all passing
  • Added unit tests for agent loop max_iterations fallback behavior (3 tests)
  • Verified all 14 JS tests pass via vitest

🤖 Generated with Claude Code

Bug 1 (Fixes agent-infra#134): createRequestUrl produced double '?' when baseUrl
already contained query parameters. Now checks for existing '?' and
uses '&' separator when appropriate.

Bug 2: Agent loop max_iterations fallback returned messages[-1] which
could be a tool response instead of an assistant message. Both
AzureOpenAIAgentLoop and OpenAIAgentLoop now search backwards for the
last assistant message.

Bug 3: Volcengine createSandbox/listSandboxes spread ...kwargs[0] on
top of already-mapped PascalCase fields, producing duplicate keys in
the JSON body. Removed redundant spread.

Bug 4: All Volcengine catch blocks silently swallowed errors by
returning them instead of rethrowing. Changed to throw so callers can
handle failures properly.

Bug 5: site-to-markdown injected raw HTML into an f-string with triple
quotes, allowing code injection if HTML contained '''. Now base64-
encodes the HTML and decodes inside the sandbox.

Bug 6: browser-use-cua example had duplicate imports (asyncio, os),
duplicate Tools() instantiation, and duplicate __main__ block. Cleaned
up to single definitions.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.

[BUG] incorrect url joining when there are other query params in baseUrl

1 participant