Skip to content

Main#252

Open
godlockin wants to merge 10 commits intoericc-ch:masterfrom
godlockin:main
Open

Main#252
godlockin wants to merge 10 commits intoericc-ch:masterfrom
godlockin:main

Conversation

@godlockin
Copy link
Copy Markdown

No description provided.

godlockin and others added 10 commits April 25, 2026 23:41
- src/lib/models.ts: resolveModel/resolveModelId with snapshot suffix stripping
  (e.g. claude-opus-4-7-{snapshot} -> claude-opus-4.7) and family alias matching
- src/lib/claude-settings.ts: read env from ~/.claude/settings*.json for
  COPILOT_REASONING_EFFORT overrides
- src/services/copilot/responses.ts: GitHub Copilot /responses endpoint adapter
  for gpt-5.3-codex / gpt-5.4-mini (uses reasoning.effort, not budget_tokens)
- routes: thread resolveModel through chat-completions and count-tokens handlers
- anthropic-types: extend thinking.type with "adaptive" and add reasoning_effort
- main.ts: install global undici Agent with 10min headers/body timeout, 2min
  keep-alive, 30s connect — default 300s headersTimeout was killing >5min
  Copilot upstream responses (DOMException TIMEOUT_ERR)
- start.ts: pass bun idleTimeout=255 (Bun max) to srvx + reusePort=true so
  keep-alive connections aren't closed under 10s default, which surfaces as
  "socket connection was closed unexpectedly" on the Claude Code side
Upstream Copilot opus-4.7 only accepts {type: "enabled"} (no "adaptive",
no "disabled"), and rejects effort levels above "medium". Coerce both
"enabled" and "adaptive" to "enabled" with optional budget_tokens, and
downgrade higher efforts to "medium" with a warning so legacy clients
keep working.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Probed upstream Copilot directly: opus-4.7 now accepts all effort levels
(low/medium/high/xhigh/max) without 400, and reasoning_effort shows real
gradient in completion tokens (low~214 → max~374) on a fixed prompt with
thinking enabled. Lift the medium cap so high-effort requests reach the
model instead of being silently downgraded.

Tests updated to reflect the new pass-through behavior.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
- New /usage/view route serving a self-contained dark-mode dashboard
  rendering quota_snapshots (chat/completions/premium_interactions)
  with progress bars, plan/SKU/reset metadata, and refresh controls.
- /usage now content-negotiates: text/html → viewer, JSON otherwise,
  preserving API compatibility.
- Auto-refresh defaults to 30s, with on/off toggle and 10s/30s/60s/5m
  selector; pauses on tab hidden, persists prefs to localStorage,
  honors ?endpoint, ?auto, ?refresh URL params.
- claude-copilot.sh: add --daemon-start/--daemon-stop subcommands and
  print log path + usage URL after server is ready.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
…vements

Brings in the installer/docs/launcher work from godlockin/master (aa4bdaf)
while keeping main's adaptive→enabled thinking translation and opened-up
opus-4.7 effort cap (low/medium/high/xhigh/max) — master had reverted
non-stream-translation.ts which silently drops the thinking field and
caused upstream 400s for clients sending thinking.adaptive.

- setup.sh: 5-step installer (deps, build, auth, shell config, launchd plist)
- claude-copilot.sh: --daemon shows local dashboard URL (usage/view)
- README: quick start, model tier table, effort support docs
- .gitignore: add copilot-data/ docker volume exclusion
- bun.lock: dependency updates from master

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
…fort

Even after coercing thinking.adaptive→enabled, upstream Copilot still
returned 400 "Input tag 'adaptive' found using 'type'" — likely because
the validator scans the overall request body (including conversation
content) for thinking-shaped strings, which is fragile when chat history
mentions the word "adaptive".

Effort already conveys reasoning intent (low→max); thinking is redundant
for this provider. Stop forwarding thinking unconditionally.

Tests: 3 thinking-translation cases updated to expect undefined.
Probe: thinking.{adaptive,enabled+budget=31999} + reasoning_effort
{low,medium,high,xhigh,max} all → 200.
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