Commit 1b613c2
fix(rest+llm): /api/v1/consult e2e wiring — env-var port + cartridge name
Closes the deferred /api/v1/consult e2e exercise from 2026-04-25 evening.
Two changes:
1. src/rust/llm.rs — `echidna-llm` → `echidna-llm-mcp` (cartridge name)
LlmAdvisor was POSTing to `/cartridge/echidna-llm/invoke` but the
actual BoJ cartridge name is `echidna-llm-mcp` (verified against
the live BoJ instance at localhost:7700 — `GET /cartridges`
returns the registered name). Pre-fix the consult call returned
404 unknown-cartridge from BoJ; post-fix it reaches the cartridge
and returns whatever the cartridge handler decides (currently 500
because BoJ is in skeleton mode — not echidna's responsibility).
2. src/interfaces/rest/main.rs — `ECHIDNA_REST_ADDR` env-var override
The hardcoded `127.0.0.1:8000` collides with other workspace
processes (Python SimpleHTTPServer was on 8000 during testing).
Reading `ECHIDNA_REST_ADDR` lets the server bind a free port for
ad-hoc e2e exercises without touching the default.
E2E verified path:
curl POST /api/v1/consult on 127.0.0.1:8765
→ handler validates non-empty question (400 on empty)
→ LlmAdvisor.check_health() succeeds against live BoJ
→ LlmAdvisor.consult() POSTs to BoJ /cartridge/echidna-llm-mcp/invoke
→ BoJ skeleton-mode invoke returns 500
→ handler maps to 502 Bad Gateway with passthrough error message
Echidna side fully wired. BoJ-side cartridge is a placeholder by
its own self-declared status (`/health` reports `mode: skeleton,
note: invocation is a placeholder`); making BoJ return real LLM
responses is a separate task tracked in boj-server.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 4241abf commit 1b613c2
2 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
| 445 | + | |
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
541 | | - | |
| 541 | + | |
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
| |||
0 commit comments