Skip to content

fix(gateway): wire provider and tools into POST /asap handler - #53

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-412d
Draft

fix(gateway): wire provider and tools into POST /asap handler#53
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-412d

Conversation

@cursor

@cursor cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Bug and impact

Inbound POST /asap task.request envelopes always failed with HTTP 400 (server missing cfg or provider), so the Phase 4 ASAP gateway endpoint could not dispatch agent tasks at all.

Root cause

handle_asap in src/gateway/routes.c zeroed asap_server_ctx_t and only set cfg from the HTTP context. It never populated provider or tools, unlike handle_message in dispatch.c which correctly uses bootstrap_get_provider() and bootstrap_tool_*().

Fix

  • Wire bootstrap_get_cfg(), bootstrap_get_provider(), and the flattened tool table into asap_ctx before calling asap_server_handle().
  • Add test_asap_task_request integration test that posts a valid envelope and expects HTTP 200 with task.response.

Validation

  • make test_gateway_http && ./build/test_gateway_http — all tests passed.
Open in Web View Automation 

handle_asap zeroed asap_server_ctx_t and only set cfg, so inbound
task.request envelopes always failed with "server missing cfg or
provider". Mirror dispatch.c bootstrap wiring and add integration test.

Co-authored-by: esadrianno <esadrianno@gmail.com>
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