Skip to content

[codex] add http chat trigger aliases and docs#221

Merged
everettjf merged 9 commits intomainfrom
microclaw-http-request-trigger
Mar 9, 2026
Merged

[codex] add http chat trigger aliases and docs#221
everettjf merged 9 commits intomainfrom
microclaw-http-request-trigger

Conversation

@everettjf
Copy link
Contributor

Summary

This PR addresses issue #218 by making MicroClaw's HTTP entrypoint easier to discover and use as a general-purpose automation trigger.

The runtime already had functional endpoints (/api/send and /api/send_stream) that can trigger agent runs from external systems, but users looking for classic chatbot naming (/chat) had no explicit API alias and very little guidance in docs.

User impact (before)

External callers (webhooks, scripts, CI jobs) could still trigger the agent, but only if they already knew Web API details and naming conventions.
That made the feature look missing from an automation perspective, which is why the issue framed it as “no general-purpose HTTP trigger”.

Root cause

The gap was primarily discoverability and API ergonomics:

  • Existing endpoints were named around Web UI semantics (send, send_stream).
  • README documentation did not include a clear headless automation section with auth + request/response examples.

What changed

  1. Added stable alias routes for chatbot-style clients:
  • POST /api/chat -> same handler as POST /api/send
  • POST /api/chat_stream -> same handler as POST /api/send_stream
  1. Added automated tests to prevent regressions:
  • test_chat_alias_matches_send_behavior
  • test_chat_stream_alias_works
  1. Added README docs (EN + CN) under Web UI section:
  • HTTP request trigger usage for headless automation
  • required API key scope (operator.write)
  • endpoint matrix and payload/response examples
  • curl example

Validation

Ran targeted tests:

  • cargo test test_chat_alias_matches_send_behavior -- --nocapture
  • cargo test test_chat_stream_alias_works -- --nocapture
  • cargo test test_send_stream_then_stream_done -- --nocapture

All passed.

Notes

This PR does not change auth/scope behavior and does not introduce a new execution model. It surfaces existing capability with clearer API naming and documentation so external automation is straightforward.

@everettjf everettjf marked this pull request as ready for review March 9, 2026 08:28
@everettjf everettjf force-pushed the microclaw-http-request-trigger branch from a127285 to 277a631 Compare March 9, 2026 08:33
@everettjf everettjf merged commit b8eb5a8 into main Mar 9, 2026
4 checks passed
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