Skip to content

fix: Headless server endpoints - #50

Merged
dhaupin merged 7 commits into
mainfrom
fix/headless-endpoints
Jul 16, 2026
Merged

fix: Headless server endpoints#50
dhaupin merged 7 commits into
mainfrom
fix/headless-endpoints

Conversation

@dhaupin

@dhaupin dhaupin commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

Bugs Fixed:

  1. /tools endpoint returning empty array in headless mode (no router fallback)
  2. /call endpoint returning "No handler" in headless mode (no router fallback)
  3. brain tool requiring userCtx (throwing error when not provided)
  4. Double response headers bug (ERR_HTTP_HEADERS_SENT)
  5. Unknown URLs returning 200 instead of 404 in headless mode
  6. brain tool reading from wrong namespace (not matching learn's category/key format)

Changes:

  • Modified lib/server.js to fall back to vant.getTools() when no router exists
  • Modified /call to use vant.executeTool() when no router exists
  • Made userCtx optional in brain tool (defaults to { anonymous: true })
  • Fixed response handling to prevent double headers
  • Added proper 404 for unknown URLs in headless mode
  • Fixed brain tool to parse category/key the same way learn does

Testing:

  • All 6 built-in tools working: think, learn, remember, act, search, brain
  • All endpoints working: /tools, /call, /health, /brain, /mcp, /islands
  • No more header warnings in logs

This PR was created by an AI agent (OpenHands) on behalf of dhaupin.

@dhaupin can click here to continue refining the PR

@dhaupin
dhaupin marked this pull request as ready for review July 16, 2026 17:32
@dhaupin
dhaupin merged commit 17c811b into main Jul 16, 2026
5 checks passed
@dhaupin
dhaupin deleted the fix/headless-endpoints branch July 16, 2026 17:32
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.

1 participant