Skip to content
PidebugCLI & tooling2 files · +105 −23

Debug web_fetch/web_search tool argument parsing in 0xKobold

Session from 0xKobolds on Hugging Face by moikapy · MIT · condensed by Coders Talk

25msession
2interventions
GOAL

The developer wanted help identifying and fixing why the web_fetch and web_search tools in their 0xKobold agent framework were failing with 'Invalid URL' errors even when passing valid https:// URLs.

  1. Prompt · +0
    Clarify what project/directory we're actually in (0xKobolds vs resume-optimizer)
  2. Agent did · +0m
    Explored directory structure and package.json to determine actual project location, eventually identifying resume-optimizer as a Next.js app living inside 0xKobolds
  3. Intervention · +10m
    Developer says they deleted the resume-optimizer copy inside 0xKobolds since it wasn't supposed to be there, redirecting to the sibling directory
    Why: the agent got confused about nested vs sibling directories so I had to correct where the real project lived
  4. Prompt · +12m
    In plan mode, what's the best model to use for a resume optimizer?
  5. Agent did · +12m
    Recommended Claude 3.5 Sonnet as primary model with GPT-4o and budget alternatives, then attempted to use web_fetch/web_search tools to verify against OpenRouter's live model list
  6. Fail · +13m
    web_fetch and web_search tools both failed with 'Invalid URL. Must start with http:// or https://' errors despite valid URLs being passed
  7. Intervention · +19m
    Developer points out the URL clearly did start with https:// so the tool itself must be broken, pushing the agent to actually investigate instead of working around it
    Why: I noticed the URL was valid so the tool code had to be buggy, not my input, and told it to look into the tool itself
  8. Prompt · +22m
    Enter plan mode and create a team of sub agents to investigate the tool failure
  9. Agent did · +23m
    Traced the bug through websearch-extension.ts, mode-manager-extension.ts, and pi-adapter.ts, concluding the framework likely nests tool arguments differently than the code expects (e.g. args.parameters.url vs args.url)
  10. Agent did · +24m
    Edited websearch-extension.ts to defensively extract url/query/question from multiple possible argument shapes for web_fetch, web_search, and web_qa, then wrote and ran a test script confirming argument extraction now works
  11. Outcome · +25m
    Root cause found and fixed: web_fetch, web_search, and web_qa now defensively extract arguments from multiple possible shapes; test script confirms valid URL extraction succeeds
VERDICT

Next time I'd tell it up front which exact directory the project lives in, since half this session was spent untangling a confused nested-vs-sibling directory mixup before we even got to real work. The fix that actually mattered was when I pushed back on the tool's own error message instead of accepting the agent's excuse that my URL was wrong - that's what got it to dig into the actual argument-passing bug in the framework.

I tried this · 0

Discussion · 0

How Builds work