Skip to content

[Bug] @v16_api / execute_api ignores the URL in a _test.md step — calls a default host, returns 404 #132

Description

@tlemmonds

Environment: kane-cli 0.4.10 (verified latest on npm) · Node 24 · Windows 11 · account toddl

Summary

A _test.md step that issues a direct API call via @v16_api / execute_api fires the tool, but silently drops the URL given in the step — the request goes to a LambdaTest default host and returns 404, instead of hitting the target URL.

Steps to reproduce

_test.md step:

Using a direct HTTP API call (not the browser UI), send a GET request to
`{{base_url}}/api/loans/L2001` and store the JSON response body as {{api_loan}}.
Assert that {{api_loan.status}} is 200.

Run with {{base_url}} resolved to a public, reachable URL (https://everdemo.onrender.com, verified 200 via curl).

Actual

  • The tool fires: Call external tool: execute_apiexecute_api with parameters: {'name': 'api_loan'}the parameters carry only name, no URL.
  • The captured response is a 404 from a LambdaTest host, not the target:
{
  "status": 404,
  "headers": [
    {"server": "cloudflare"},
    {"set-cookie": "__cf_bm=...; Domain=lambdatest.com; ..."}
  ],
  "response_body": "<html>...<title>404 Not Found</title>...<center>nginx/1.18.0 (Ubuntu)</center>..."
}
  • {{api_loan.status}} resolves to 404; the assertion fails. Reproduced against both http://localhost:3000 and https://everdemo.onrender.com — the base URL is correctly resolved in variables (global.base_url = https://everdemo.onrender.com) but is not used by the request.

Two problems

  1. The inline URL is dropped silently. execute_api appears to require the request (URL / method / headers) to be pre-defined and named in KaneAI web, then referenced by name — there is no way to issue an ad-hoc API call to an arbitrary URL from a _test.md. The URL in the step is ignored rather than used or errored on.
  2. No loud failure. Instead of erroring "no URL resolved for api_loan", the runtime calls a default host and returns a misleading 404, which reads like a real API failure.

Note: execute_api runs server-side on the KaneAI cloud, so it also cannot reach localhost — the target must be network-reachable from the cloud (a QA/dev/deployed env). That part is expected; the URL-dropping is not.

Expected

  • Honor the URL and method specified in the step (or provide an explicit inline API-definition surface for _test.md).
  • If no URL resolves, fail loudly ("no endpoint for execute_api[api_loan]") rather than calling a default host.

Relationship to #121

#121's "confirmation the runtime supports it" note states a step "fetched GET /api/loans/LOAN-2001/schedule and returned status 200 + the JSON body." That success is only reproducible when the API request is pre-defined/named in KaneAI web — an inline URL in the step does not reach the target (this issue). The execute_api mechanism works; sourcing the URL from the step does not.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions