fix(serve): honor --cors for the decision server

Draft
SH
12h ago
+60-12

wally serve --cors was ignored for decision models, so browser preflight requests returned 404 without CORS headers.

The decision server now receives the flag, answers OPTIONS before routing, and adds CORS headers to both successful and error responses. Behavior without --cors stays the same.

Validation with a real decision model covered default-off behavior, preflight 204, POST 200, and headers on 400/404/413/431 responses. Browser validation and the runtime 500 path were not exercised.

CI and formatting pass. The local full suite had 565 passes and two Windows symlink-privilege failures. Strict Clippy reports four pre-existing lints in untouched files.


Summary by cubic

Fixes --cors being ignored by the local decision server, so browser-based decision requests now behave like the LLM server. Previously the flag applied only to the LLM server; a decision model routed to the local decision endpoint skipped it and OPTIONS preflight returned 404.

  • Passes --cors through to the decision server and answers OPTIONS with 204 before method/path routing, omitting Content-Length on 204 responses per RFC 9110.
  • Adds the same Access-Control-Allow-Origin, Access-Control-Allow-Methods, and Access-Control-Allow-Headers values the LLM server uses to every response, errors included.
  • Behavior without --cors is unchanged.