Skip to content

v0.13.0

Latest

Choose a tag to compare

@PythonLuvr PythonLuvr released this 21 May 01:41
· 4 commits to main since this release

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 to 0.0.0.0 requires explicit intent and warns at startup.
  • Bearer-token auth with constant-time comparison. OpenAI-shaped 401 on failure. --no-auth exists for local dev and warns every startup.
  • Conservative authorized_costs default (filesystem_read only). The startup banner explains the expansion pattern for agentic clients.
  • --max-concurrent gate (default 4). Excess requests get an OpenAI-shaped rate_limit_error 429.

Observability

  • Every proxied request writes a trace at ~/.openwar/sessions/proxy-<uuid>.trace.ndjson.
  • Every response carries an X-OpenWar-Trace-Id header for correlation. Standard OpenAI clients ignore it; OpenWar-aware tooling can read it and run openwar inspect.
  • Two new trace event types: proxy_request and proxy_response. TRACE_SCHEMA_VERSION bumps 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 tools to response tool_calls). v0.13.0 records the tool count in the trace but does not dispatch tools.
  • PermissionBridge negotiation via openwar:request_permission tool 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.