Use OpenWar from any tool that speaks the OpenAI API.
v0.13.0 ships openwar serve --openai-compat, an OpenAI Chat Completions HTTP server in front of OpenWar's runtime. Any tool that speaks OpenAI's API (Aider, Continue, Cline, the OpenAI SDKs, homegrown wrappers) points at the proxy with one env-var change and runs through OpenWar's phase-gated, traced, detector-enforced execution. The tool does not know OpenWar exists.
This is the MVP cut. Plain-text streaming and non-streaming chat completions work end-to-end against any upstream adapter. Tool round-trip and PermissionBridge negotiation land in v0.13.1.
What ships
openwar serve --openai-compat
A new CLI subcommand. Hand-rolled node:http server with a hand-rolled SSE encoder. Zero new dependencies.
Endpoints:
POST /v1/chat/completions: streaming SSE and non-streaming JSON.GET /v1/models: returns the configured upstream as a single model entry.GET /healthz: liveness probe.- All other paths return an OpenAI-shaped 404.
Security defaults
- Localhost-default bind (
127.0.0.1). Binding to0.0.0.0requires explicit intent and warns at startup. - Bearer-token auth with constant-time comparison. OpenAI-shaped 401 on failure.
--no-authexists for local dev and warns every startup. - Conservative
authorized_costsdefault (filesystem_readonly). The startup banner explains the expansion pattern for agentic clients. --max-concurrentgate (default 4). Excess requests get an OpenAI-shapedrate_limit_error429.
Observability
- Every proxied request writes a trace at
~/.openwar/sessions/proxy-<uuid>.trace.ndjson. - Every response carries an
X-OpenWar-Trace-Idheader for correlation. Standard OpenAI clients ignore it; OpenWar-aware tooling can read it and runopenwar inspect. - Two new trace event types:
proxy_requestandproxy_response.TRACE_SCHEMA_VERSIONbumps from 4 to 5. Additive.
Phase machine in proxy mode
Each request synthesizes an in-memory brief (mode: auto, scope_locked: true). Phase 0 and Phase 4 run without operator prompts (the proxy cannot block on stdin). Phase 3 still fires; v0.13.0 ships the denial path (a refusal-text completion with finish_reason: content_filter when a destructive action is blocked). Full PermissionBridge negotiation lands in v0.13.1.
Upstream composition
The proxy routes the actual completion to any configured upstream adapter: Anthropic, OpenAI, Gemini, Grok, openai-compat, or cli-bridge. When the upstream is cli-bridge, the proxy warns about per-request CLI cold-start cost and recommends --max-concurrent 1.
Stats
- 909 tests (up from 849). 60 new across
tests/serve/. - Coverage gates green.
- Zero new runtime dependencies.
node:http, hand-rolled SSE,node:crypto.randomUUID.
Deferred to v0.13.1
- Tool-call round-trip (request
toolsto responsetool_calls). v0.13.0 records the tool count in the trace but does not dispatch tools. - PermissionBridge negotiation via
openwar:request_permissiontool calls. - Comprehensive Continue / Cline / Cursor integration examples.
Upgrade notes
Drop-in. npm update @pythonluvr/openwar from v0.12.1 picks this up automatically. No existing CLI command, library export, or trace event shape changes. The openwar serve subcommand and the two new trace events are additive.
To use the proxy: run openwar serve --openai-compat --auth-token <token>, then point your OpenAI-API tool at http://127.0.0.1:1234/v1 with the token as its API key. Full setup, the security model, and the supported request surface are documented in docs/openai-proxy.md.