Skip to content

Latest commit

 

History

History
251 lines (176 loc) · 14.4 KB

File metadata and controls

251 lines (176 loc) · 14.4 KB

Logbook

This branch was backfilled against master, which is the default branch in this repo. There is no local main branch.

  • Branch point: 0ea08fe (chore: release v0.7.0)
  • Backfill window: 2026-03-08 through 2026-03-16
  • Current head at backfill time: 641fb1e (Fix Bun streaming request timeouts)
  • Net branch diff vs master: 29 files changed, 2659 insertions, 33 deletions

2026-03-08

Responses API support and model-level routing

Commits:

  • 42214b8 feat: port PR #205 — Responses API support and model-level routing
  • b188c93 fix: address review issues in Responses API implementation
  • e408560 feat: add gpt-5.4 with full level support via Responses API
  • 26cbf7f chore: update bun.lock

What changed:

  • Added OpenAI Responses API endpoints at /responses and /v1/responses.
  • Added upstream Responses client support in src/services/copilot/create-responses.ts.
  • Added translation between chat completions and responses models in src/routes/chat-completions/responses-translation.ts.
  • Introduced model-level routing in src/lib/model-level.ts, including support for level suffixes and gpt-5.4.
  • Updated model listing and routing so Responses-capable models are exposed and handled correctly.
  • Followed up with review fixes and a lockfile refresh.

Request and session usage logging

Commits:

  • 8f115dc feat: add per-request and session usage logging
  • 716170c feat: include thinking level in request log
  • d77b3aa fix: pick up thinking level from reasoning_effort/reasoning.effort fields
  • 4cb8bca fix: pick up reasoning.effort level in responses route

What changed:

  • Added src/lib/request-log.ts to centralize request accounting.
  • Extended src/lib/state.ts with per-model session usage counters.
  • Logged token usage for chat completions, Anthropic messages, and Responses API flows.
  • Added thinking/reasoning level extraction so usage logs reflect reasoning_effort and reasoning.effort.
  • Tightened the Responses route so it records reasoning level consistently.

2026-03-14

Opt-in proxy exchange capture

Commits:

  • eac1024 feat: add opt-in proxy exchange capture
  • 5647f81 Merge branch 'feat/proxy-exchange-capture' into dev

What changed:

  • Added --capture and --capture-path to the start command in src/start.ts.
  • Added src/lib/exchange-capture.ts to persist request/response exchanges as JSONL.
  • Captures include request metadata, upstream IDs, request bodies, response bodies, and token usage across chat, embeddings, messages, and responses routes.
  • Added redaction of sensitive values before persistence.
  • Added automatic gzip compression for older daily capture files under the default capture directory.
  • Added supporting path/state plumbing in src/lib/paths.ts, src/lib/state.ts, and src/lib/upstream-trace.ts.
  • Documented the feature in README.md and the RFC at docs/rfcs/opt-in-proxy-exchange-capture.md.
  • Added focused test coverage in tests/exchange-capture.test.ts.

2026-03-16

SSE forwarding hardening

Commit:

  • 9e2a4e6 Harden SSE stream forwarding

What changed:

  • Added src/lib/sse.ts to normalize and forward upstream SSE frames safely.
  • Fixed handling for metadata-only SSE events so events without data do not crash or get dropped incorrectly.
  • Hardened streaming behavior in chat completions and responses handlers.
  • Added test coverage in tests/responses-route-stream.test.ts and tests/sse.test.ts.

Bun streaming request timeout handling

Commit:

  • 641fb1e Fix Bun streaming request timeouts

What changed:

  • Added startup-side idle-timeout parsing and validation in src/start.ts.
  • Corrected the configurable Bun idle-timeout range to 0-255.
  • Added src/lib/request-timeout.ts to disable Bun request timeouts on streaming requests.
  • Applied per-request timeout disabling for streaming chat completions, Anthropic messages, and Responses API routes.
  • Documented the timeout behavior in README.md.
  • Added tests in tests/request-timeout.test.ts and tests/start-idle-timeout.test.ts.

2026-03-17

Activity dashboard and telemetry hardening

What changed:

  • Added a built-in activity dashboard at /dashboard with summary cards, quota snapshots, a full-width live log, and a locally served Chart.js history plot.
  • Added a SQLite-backed dashboard telemetry store with backfill from persisted JSONL and gzipped capture files plus an SSE live event stream.
  • Captured telemetry for chat completions, Anthropic messages, Responses API, and embeddings, including completed requests, upstream errors, proxy errors, and client aborts.
  • Changed the history chart to stacked input and output bars with hover breakdown by model, while keeping the model filter as a scope over the plotted data.
  • Filled missing hour/day/week/month buckets so zero-traffic intervals still appear in the history series.
  • Moved the model filter to the history pane header and compacted the bucket/range controls into the chart toolbar with responsive native selects on narrower screens.
  • Replaced the default Hono request logger with a timestamped consola reporter and a single standardized HTTP access log line that includes method, path, status, and duration.
  • Added a --log-level startup option and centralized runtime log formatting in src/lib/logger.ts, while preserving --verbose as a compatibility shortcut.
  • Hardened dashboard telemetry persistence so SQLite I/O failures degrade the dashboard store to in-memory mode instead of breaking proxied requests.
  • Added dashboard coverage in tests/dashboard.test.ts, including API aggregation, backfill, live stream, and local chart asset checks.
  • Added startup logging coverage in tests/start-idle-timeout.test.ts.

2026-03-18

Multi-backend OpenAI OAuth support

Commit:

  • 4d9728d Add OpenAI OAuth backend and backend-aware dashboard

What changed:

  • Added a process-wide backend switch with --backend copilot|openai-oauth.
  • Added OpenAI OAuth login, token persistence, refresh, and static model exposure for ChatGPT Plus/Pro Codex-style usage.
  • Routed OpenAI-compatible and Anthropic-compatible traffic through the selected backend, with OpenAI OAuth using the Responses backend for compatibility flows.
  • Added backend-aware request logging, exchange capture, telemetry persistence, and dashboard filtering.
  • Kept a single dashboard UI and added All backends, Copilot, and OpenAI OAuth filtering.
  • Added focused tests for backend-filtered dashboard behavior and backend-specific 501 responses.

Multi-backend review follow-up

Working tree progress:

  • Fixed direct /v1/responses handling so model(level) variants normalize to the base model plus reasoning.effort before upstream dispatch.
  • Fixed streamed Anthropic-over-Responses accounting so OpenAI OAuth streaming usage is preserved in logs and telemetry.
  • Updated README.md to document --capture, --capture-path, --log-level, --backend, the built-in dashboard UI, and backend-specific endpoint behavior.

Dashboard history and runtime logging refinement

Commit:

  • 0a05b26 feat: refine dashboard history and runtime logging

What changed:

  • Refined the token history chart to render stacked input and output bars while using per-bucket model breakdown data for hover details.
  • Kept the model filter as a scope over the charted data instead of using model-stacked bars directly.
  • Filled missing history buckets across the supported bucket sizes so gaps in traffic still render as zero-value bars.
  • Moved the model selector into the token history header and kept bucket/range controls compact with responsive native selects on narrower widths.
  • Standardized runtime logging around a timestamped consola reporter and a single HTTP access log line with method, path, status, and duration.
  • Added --log-level startup support while keeping --verbose as a backwards-compatible shortcut.

Dashboard quota card follow-up

Working tree progress:

  • Adjusted the quota card status line so negative remaining values render as N overage instead of -N left.
  • Removed the redundant overage text from the quota card footer so it now shows entitlement only.
  • Re-checked the inline dashboard client with new Function(dashboardScript), bunx --bun tsc --noEmit, and bunx --bun eslint --cache src/routes/dashboard/page-script.ts.

Dashboard log severity follow-up

Working tree progress:

  • Split telemetry severity from outcome so client_aborted entries can still render as INFO when the disconnect classification says the stream was effectively complete.
  • Persisted that severity through live telemetry, SQLite storage, and exchange capture backfill so future rebuilds from .jsonl data keep the same dashboard tone.
  • Updated the live log line format to include the severity token and switched log-card styling to follow severity instead of treating every client_aborted exchange as warning-colored.
  • Added focused coverage for severity preservation and the late-disconnect info path, then rechecked with targeted Bun tests, bunx --bun tsc --noEmit, and ESLint on the touched files.

Late stream disconnect classification

Commits:

  • 3a23ff5 feat: classify late stream disconnects
  • 8d6480b Merge branch 'fix/late-stream-disconnect' into dev
  • 24236be test: cover stream disconnect log levels
  • 9c883d4 Merge branch 'fix/late-stream-disconnect' into dev

What changed:

  • Added src/lib/stream-client-disconnect.ts to classify downstream aborts by stream phase instead of treating every disconnect as the same warning.
  • Responses, chat completions, Codex-via-responses, and Anthropic streaming handlers now track whether a terminal event or [DONE] sentinel was seen or written before the client disconnected, along with forwarded SSE frame count.
  • Stream disconnect logs now emit as a single machine-friendly key/value line such as stream_client_disconnect requestId=... route=... disconnectPhase=... completionEstimate=... forwardedChunks=... late=....
  • Added an explicit completionEstimate field so tail-end disconnects can be distinguished from materially incomplete streams without relying only on the chunk count.
  • Kept telemetry capture behavior unchanged: these exchanges are still recorded as client_aborted; only the operator-facing logging was refined.
  • Added focused coverage in tests/stream-client-disconnect.test.ts and rechecked the changes with targeted route tests, typecheck, and ESLint.
  • Followed up with explicit tests that logStreamClientDisconnect(...) emits warn for early disconnects, info for late disconnects, and preserves the single-line machine-friendly payload.

2026-03-19

OAuth auth and telemetry persistence follow-up

Working tree progress:

  • Fixed the OpenAI OAuth browser flow to use the localhost callback URL expected by the upstream auth flow.
  • Added source-run script shortcuts so bun run start, bun run dev, bun run auth, and bun run debug invoke the CLI subcommands directly.
  • Kept dashboard telemetry persistent by default even when --capture is off, so usage history survives restart without requiring raw exchange capture.
  • Added --ephemeral as an explicit in-memory-only dashboard mode for one-off sessions.
  • Defined --ephemeral and --capture as conflicting flags instead of silently picking one behavior.
  • Updated README.md to explain the difference between persistent dashboard telemetry, opt-in raw exchange capture, and ephemeral mode.

Dashboard backend scope clarification

Working tree progress:

  • Added an explicit activeBackend field to the dashboard overview payload so the UI can distinguish the proxy's runtime backend from the dashboard's selected backend scope.
  • Updated the dashboard top badges to show Active Backend separately from Scope, and adjusted related status/log copy to use scope wording where the dashboard is describing filtered history rather than the process runtime backend.
  • Added coverage that the overview API preserves the active backend even when the dashboard is filtered to a different backend scope.

2026-03-21

Copilot token health alerting

Working tree progress:

  • Added Copilot token expiry tracking and refresh-failure state in src/lib/state.ts and src/lib/token.ts.
  • Switched Copilot token refresh to record failures without crashing the process, so the existing token can stay in use until the next successful refresh.
  • Added a dashboard token-health endpoint and a persistent top banner that appears when the Copilot token has expired and refresh has failed.

Copilot token-health dashboard cleanup

Working tree progress:

  • Removed the standalone token-health polling loop from the dashboard client so the page no longer hits /dashboard/api/token-health on a timer.
  • Folded token-health into the existing dashboard overview payload and surfaced the warning as a compact badge in the top bar instead of a separate empty banner panel.
  • Relaxed the dashboard alert condition so a refresh failure alone is enough to surface the warning.
  • Added coverage for the new overview payload shape and updated the dashboard page asset expectations accordingly.
  • Added coverage for token-health reporting, the refresh failure path, and the dashboard shell for the banner.
  • Updated the Responses SSE route test fixture so the mocked module still provides the route-level normalization export.

Commit Trail

  • 42214b8 2026-03-08 feat: port PR #205 — Responses API support and model-level routing
  • b188c93 2026-03-08 fix: address review issues in Responses API implementation
  • e408560 2026-03-08 feat: add gpt-5.4 with full level support via Responses API
  • 8f115dc 2026-03-08 feat: add per-request and session usage logging
  • 716170c 2026-03-08 feat: include thinking level in request log
  • d77b3aa 2026-03-08 fix: pick up thinking level from reasoning_effort/reasoning.effort fields
  • 4cb8bca 2026-03-08 fix: pick up reasoning.effort level in responses route
  • 26cbf7f 2026-03-08 chore: update bun.lock
  • eac1024 2026-03-14 feat: add opt-in proxy exchange capture
  • 5647f81 2026-03-14 Merge branch 'feat/proxy-exchange-capture' into dev
  • 9e2a4e6 2026-03-16 Harden SSE stream forwarding
  • 641fb1e 2026-03-16 Fix Bun streaming request timeouts
  • 0a05b26 2026-03-18 feat: refine dashboard history and runtime logging
  • 3a23ff5 2026-03-18 feat: classify late stream disconnects
  • 8d6480b 2026-03-18 Merge branch 'fix/late-stream-disconnect' into dev
  • 24236be 2026-03-18 test: cover stream disconnect log levels
  • 9c883d4 2026-03-18 Merge branch 'fix/late-stream-disconnect' into dev