diff --git a/CHANGELOG.md b/CHANGELOG.md index 414c49c8..8f95ef4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.0] - 2026-07-12 + ### Added +- **Sign in with ChatGPT — use OpenAI models on a ChatGPT Plus/Pro + subscription instead of metered API billing** (#698). `clawcodex login → + openai → subscription` runs an OAuth login (browser loopback, + device-code, or import from an existing Codex CLI login) and routes + requests through the ChatGPT Codex backend's Responses API. Subscription + models: `gpt-5.5`, `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.3-codex-spark`, with + encrypted-reasoning replay across turns; a configured `OPENAI_API_KEY` + always wins, and subscription usage reports `billing_mode: subscription` + (billed as `$0`). +- **Claude Pro/Max subscription login** (#697). `clawcodex login → + anthropic → subscription` connects a Claude subscription over OAuth + (PKCE), with automatic token refresh, `mcp_`-prefixed tool adaptation, + and the same `$0` accounting. +- **Meta provider + `muse-spark-1.1`** (#692) — the `api.meta.ai` + OpenAI-compatible reasoning model with a 1M-token context window, added + as a one-row `ProviderSpec`. +- **`/plan` mode** with implicit plan-mode entry/exit + (`EnterPlanMode`/`ExitPlanMode`), ported from the reference (#676). +- **`--worktree` / `-w` session isolation** — run parallel sessions in + isolated git worktrees, wired through the launcher, backend, and TUI + (#672). - **`/loop` scheduled tasks now actually fire — full port of Claude Code's session-scoped scheduler** (docs/en/scheduled-tasks). A new `src/scheduled_tasks` engine parses standard 5-field vixie cron @@ -64,6 +87,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- **Claude subscription login repaired** (#702). The Anthropic OAuth login + migrated off `console.anthropic.com` to `platform.claude.com`, and the + token exchange sent no `User-Agent` — so `urllib`'s default signature was + Cloudflare bot-blocked (`error code: 1010`) before it reached OAuth. + Updated the token/authorize/redirect endpoints and scopes to the current + upstream config (subscriber authorize base `claude.com/cai/oauth/authorize`) + and send a genuine `User-Agent`. +- **Adaptive thinking is only sent to models that support it** (#699). + Requests previously sent `thinking={"type":"adaptive"}` to every Claude + 4.x model, which the API rejects for all but Opus 4.6/4.7 and Sonnet 4.6 + ("adaptive thinking is not supported on this model"). Models that support + thinking but not adaptive now get a token budget instead; `output_config` + effort is gated to the models that accept it. +- **Semantic tool-input coercion + parity validation errors** (#700) — + string-coerce boolean/number tool arguments (mirroring the reference's + `semanticBoolean`/`semanticNumber`) and format schema-validation failures + to match `formatZodValidationError`. - Bounded the ESC-cancel worker-thread queue in `OpenAICompatibleProvider.chat_stream_response` (`src/providers/openai_compatible.py`) to `maxsize=64`. Previously an unbounded `queue.Queue` let an orphaned worker accumulate chunks in memory indefinitely when a proxy kept sending bytes after abort without closing the SDK iterator (#278). - **URLs the agent prints are clickable again.** The TUI markdown renderer (`ui-tui/src/components/markdown.tsx`) replaced every visible URL with a diff --git a/README.md b/README.md index f184e263..193e2522 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ The `session`, `settings`, and `env` blocks are optional — sensible defaults a ## 📰 News +- **2026-07-12 (v1.1.0):** **ClawCodex v1.1.0 — run OpenAI *and* Claude models on your subscription, not metered API billing** — the headline of 1.1.0 is **subscription auth for the two biggest model families**, so you can point ClawCodex at a plan you already pay for. **Sign in with ChatGPT (#698):** `clawcodex login → openai → subscription` (browser, device-code, or import from an existing Codex CLI login) routes requests through the ChatGPT Codex backend's Responses API — `gpt-5.5`, `gpt-5.4`, `gpt-5.4-mini`, and `gpt-5.3-codex-spark` on your Plus/Pro allowance, with encrypted-reasoning replay across turns and **$0** metered cost. **Claude Pro/Max (#697):** `clawcodex login → anthropic → subscription` connects a Claude subscription via OAuth (PKCE) with automatic token refresh and the same $0 accounting; follow-ups repaired the login after Anthropic moved its OAuth endpoints to `platform.claude.com` (#702) and stopped sending adaptive thinking to models that don't support it (#699). A configured API key always wins, and subscription usage reports `billing_mode: subscription`. **More models:** a Meta (`api.meta.ai`) provider with the 1M-context `muse-spark-1.1` reasoning model (#692) and refreshed MiniMax parameters (#696). **Workflow & TUI:** `/plan` mode with implicit plan-mode entry/exit (#676), `--worktree/-w` session isolation for parallel runs in separate git worktrees (#672), the `/memory` picker + `$EDITOR` spawn (#693), config/state directories rebranded `.claude → .clawcodex` with a one-time migration (#678), `/logo` startup color schemes (#677), plus TUI polish — Tab accepts the suggested placeholder (#690), past inputs get the Claude-Code highlight band (#691), clickable agent URLs (#694), and a per-terminal link-open affordance (#701). **Quality:** semantic tool-input coercion with parity validation errors (#700) and looser, Claude-Code-faithful permission granting (#673). - **2026-07-07:** **`/loop` scheduled tasks now actually fire — full port of Claude Code's session-scoped scheduler (#680)** — the bundled `/loop` skill finally has a real engine behind it: a new `src/scheduled_tasks` module parses standard 5-field cron expressions and fires due prompts **between turns** from the agent-server's idle poll. `CronCreate`/`CronList`/`CronDelete` register real firing jobs (8-char IDs, 50-job cap, deterministic jitter, 7-day recurring expiry with one final fire), and the new **`ScheduleWakeup`** tool drives self-paced `/loop` mode — the model picks each next delay (1 min–1 hr), `stop: true` ends the loop, and a ~20-minute fallback wakeup catches iterations that forget to reschedule. Typed skill slash commands now reach the backend (new `skill_command` control), so `/loop 5m check ci` works from the composer with completion + argument hint; the TUI shows a live countdown indicator (`⟳ loop wakeup in 2m 14s · ⏰ 1 scheduled`) and **Esc while idle stops a waiting loop**. `/clear` drops session tasks, `--resume` restores unexpired ones, `CLAWCODEX_DISABLE_CRON=1` disables the scheduler. 117 new tests; verified live over stdio NDJSON and a real PTY TUI drive (typed dispatch → CronCreate → a real wakeup fire between turns → Esc-stop). - **2026-07-07:** **Bounded the ESC-cancel chunk queue in OpenAI-compatible streaming (#278)** — `OpenAICompatibleProvider.chat_stream_response`'s worker-thread queue (added in #148) was an unbounded `queue.Queue`. A non-graceful disconnect from a proxy that keeps sending bytes after ESC (and never closes the SDK iterator) let the orphaned worker thread accumulate chunks in memory indefinitely. The queue is now capped at 64 chunks, so `put()` blocks the worker once full instead of growing without bound. - **2026-07-06 (v1.0.0):** **ClawCodex v1.0.0 — the 1.0 release: goal-directed autonomy, hooks & MCP wired for production, and a hardened permission system** — 86 commits since v0.7.0 (#580–#668) finish wiring the big subsystems end-to-end and graduate ClawCodex to 1.0. **Goal-directed autonomy:** the `/goal` + `/subgoal` completion-condition loop keeps the agent working until an LLM judge confirms the goal is actually met (#664), the new Monitor tool streams long-running shell output with backpressure (#665), background-bash completion notifications (#663), coordinator mode wired end-to-end on the live paths (#634), and `/advisor` token-efficient worker/reviewer pairing restored on the Ink TUI (#668). **Hooks live in production:** configured hooks now actually fire — bootstrap Hooks abstraction (#583), UserPromptSubmit (#597), multi-scope + lifecycle hooks (#595), `if` pre-filters (#643), PreToolUse `permissionDecision` (#655), PermissionRequest hooks at the ask seam (#637), MCP elicitation hooks (#659), and teammate TaskCompleted / TeammateIdle stop hooks (#642). **MCP completion:** OAuth server auth via the `/mcp` flow (#662), live `tools/list_changed` refresh (#598, #604), server instructions injected into the system prompt (#654), and `clawcodex mcp serve` re-exposes ClawCodex tools as an MCP stdio server (#635). **Permission hardening:** readable approval boxes with broadenable, persistent session grants (#608–#611), compound-command permission parity (#622), Bash normalization hardening (#626), `disableBypassPermissionsMode` lockdown (#660), an honest refuse-to-start unsandboxed guard (#658), subprocess secret-scrubbing (#650), and a flag-gated LLM security-classifier lane for auto mode (#589). **TUI maturity:** faithful Claude Code look & feel — diff rendering, tool-call transcript, task list, composer + permission-mode badge, busy line (#612–#616) — plus a minimal vim editing engine (#667), Esc-interrupt with a defanged Ctrl+C (#625), fully editable multi-line input (#621), slash-command argument hints (#631), a persistent session-stats line (#657), and restored `/cost`, `/skills`, and `/model` (#627, #629, #630). **Reliability:** the production compaction pipeline is wired and auto-compact actually applies its result (#587, #607), full retry lane + model fallback + message-history caching (#586), parallel Agent fan-out with the concurrency-cap deadlock fixed (#590), killing a background agent really stops the run (#606), and output styles work end-to-end (#640). Codebase stats: 1,170 Python files, **256,909 lines** (up from 233,520 lines on 2026-06-11). @@ -110,8 +111,6 @@ The `session`, `settings`, and `env` blocks are optional — sensible defaults a - **2026-06-21:** **18 new LLM providers — the registry grows 7 → 25 (#377)** — a data-driven `ProviderSpec` registry adds 18 OpenAI-compatible backends (nvidia-nim, fireworks, together, moonshot/Kimi, novita, siliconflow, deepinfra, stepfun, arcee, huggingface, volcengine, xiaomi-mimo, atlascloud, wanjie-ark, plus local ollama / vllm / sglang) alongside the hand-written providers; alias-aware config resolution, standard env-var key fallback (e.g. `TOGETHER_API_KEY`), and keyless local servers. - **2026-06-18:** **DeepSeek prefix-cache exploitation — a HUGE token-cost win (#363)** — ClawCodex now keeps its request prefix **byte-stable** across turns so DeepSeek's automatic prompt-prefix cache covers the entire `system + tools + history` span. Per-request-volatile sections (env, the mutable `MEMORY.md` body, plan-mode, etc.) are relocated to a trailing `` *after* the conversation history, so the cached prefix never breaks even when memory/env change. We also register DeepSeek's **1M-token context window**, map its prompt-cache usage onto the Anthropic `cache_read_input_tokens` convention, and surface a per-model **prompt-cache hit-rate** + cost in `/cost`. **Why this is enormous — the token economics:** Claude Fable 5 runs **$10 / $50** per 1M input/output tokens, while **DeepSeek-V4-Pro is just $0.435 / $0.87** — already **~23× cheaper on input** and **~57× cheaper on output**. And because **cache-hit input is billed at only 10%** of the normal input rate, the long, context-heavy sessions that agentic coding actually produces pay just **~$0.0435 per 1M input tokens** — roughly **230× cheaper than Fable 5 input**. The token efficiency ClawCodex unlocks here is **HUGE**. Everything is gated to the `deepseek` provider — every other provider's request is byte-for-byte unchanged. Follow-up: truncated tool-call argument JSON is now best-effort recovered in the shared OpenAI-compatible layer, so an interrupted DeepSeek stream keeps its partial tool args instead of dropping them to `{}` (#364). - **2026-06-16:** **Z.ai GLM-5.2 support (#343)** — new `zai` provider for Z.ai's OpenAI-compatible GLM Coding Plan (`https://api.z.ai/api/coding/paas/v4`), shipping `GLM-5.1` and the `GLM-5.2` preview; GLM-5.2 delivers coding capability comparable to Claude Opus 4.7. First app built end-to-end with GLM-5.2 — a [FIFA World Cup 2026 intro page](demos/wc26-intro/index.html) (animated hero + live countdown, three host nations, 16 stadiums, tournament format, and record-breaking facts). -- **2026-06-11:** **Codebase stats** — Total Python files: 1,093 files; Total Lines of Python Code: **233,520 lines** (up from 213,777 lines on 2026-05-29; ~+19.7k lines from the interactive command-system batch, the dynamic workflow engine + `/deep-research`, and the Tavily web-tooling refresh). -- **2026-06-10 to 2026-06-11:** **Dynamic workflow engine + `/deep-research` (#262–#264, #266–#271)** — Python workflow engine core (`agent()`/`parallel()`/`pipeline()`/`phase()`, journaling, resume) wired end-to-end: Workflow tool, `/workflows` TUI dialog + status-line pill, per-agent retry, worktree isolation, result delivery, and the bundled `/deep-research` harness registered as a slash command. Reliability: LLM read timeout applied centrally to all openai-compatible providers (#269), parallel agents no longer serialize on the event loop (#270), and the deep-research synthesize step forbids tools so the report-writer can't loop (#271). Follow-ups: workflow max-turns cap fix (#272), deep-research verdict-enum fix (#273), rich `/workflows` live monitor with phase progress + per-agent stats (#287). 📚 Older items have moved to the full **[News archive](docs/NEWS.md)**. *** diff --git a/docs/NEWS.md b/docs/NEWS.md index 23e3effc..29b08b6a 100644 --- a/docs/NEWS.md +++ b/docs/NEWS.md @@ -2,6 +2,7 @@ Full news history for ClawCodex. The [README News section](../README.md#-news) keeps only the 10 most recent items. +- **2026-07-12 (v1.1.0):** **ClawCodex v1.1.0 — run OpenAI *and* Claude models on your subscription, not metered API billing** — the headline of 1.1.0 is **subscription auth for the two biggest model families**, so you can point ClawCodex at a plan you already pay for. **Sign in with ChatGPT (#698):** `clawcodex login → openai → subscription` (browser, device-code, or import from an existing Codex CLI login) routes requests through the ChatGPT Codex backend's Responses API — `gpt-5.5`, `gpt-5.4`, `gpt-5.4-mini`, and `gpt-5.3-codex-spark` on your Plus/Pro allowance, with encrypted-reasoning replay across turns and **$0** metered cost. **Claude Pro/Max (#697):** `clawcodex login → anthropic → subscription` connects a Claude subscription via OAuth (PKCE) with automatic token refresh and the same $0 accounting; follow-ups repaired the login after Anthropic moved its OAuth endpoints to `platform.claude.com` (#702) and stopped sending adaptive thinking to models that don't support it (#699). A configured API key always wins, and subscription usage reports `billing_mode: subscription`. **More models:** a Meta (`api.meta.ai`) provider with the 1M-context `muse-spark-1.1` reasoning model (#692) and refreshed MiniMax parameters (#696). **Workflow & TUI:** `/plan` mode with implicit plan-mode entry/exit (#676), `--worktree/-w` session isolation for parallel runs in separate git worktrees (#672), the `/memory` picker + `$EDITOR` spawn (#693), config/state directories rebranded `.claude → .clawcodex` with a one-time migration (#678), `/logo` startup color schemes (#677), plus TUI polish — Tab accepts the suggested placeholder (#690), past inputs get the Claude-Code highlight band (#691), clickable agent URLs (#694), and a per-terminal link-open affordance (#701). **Quality:** semantic tool-input coercion with parity validation errors (#700) and looser, Claude-Code-faithful permission granting (#673). - **2026-07-07:** **`/loop` scheduled tasks now actually fire — full port of Claude Code's session-scoped scheduler (#680)** — the bundled `/loop` skill finally has a real engine behind it: a new `src/scheduled_tasks` module parses standard 5-field cron expressions and fires due prompts **between turns** from the agent-server's idle poll. `CronCreate`/`CronList`/`CronDelete` register real firing jobs (8-char IDs, 50-job cap, deterministic jitter, 7-day recurring expiry with one final fire), and the new **`ScheduleWakeup`** tool drives self-paced `/loop` mode — the model picks each next delay (1 min–1 hr), `stop: true` ends the loop, and a ~20-minute fallback wakeup catches iterations that forget to reschedule. Typed skill slash commands now reach the backend (new `skill_command` control), so `/loop 5m check ci` works from the composer with completion + argument hint; the TUI shows a live countdown indicator (`⟳ loop wakeup in 2m 14s · ⏰ 1 scheduled`) and **Esc while idle stops a waiting loop**. `/clear` drops session tasks, `--resume` restores unexpired ones, `CLAWCODEX_DISABLE_CRON=1` disables the scheduler. 117 new tests; verified live over stdio NDJSON and a real PTY TUI drive (typed dispatch → CronCreate → a real wakeup fire between turns → Esc-stop). - **2026-07-07:** **Bounded the ESC-cancel chunk queue in OpenAI-compatible streaming (#278)** — `OpenAICompatibleProvider.chat_stream_response`'s worker-thread queue (added in #148) was an unbounded `queue.Queue`. A non-graceful disconnect from a proxy that keeps sending bytes after ESC (and never closes the SDK iterator) let the orphaned worker thread accumulate chunks in memory indefinitely. The queue is now capped at 64 chunks, so `put()` blocks the worker once full instead of growing without bound. - **2026-07-06 (v1.0.0):** **ClawCodex v1.0.0 — the 1.0 release: goal-directed autonomy, hooks & MCP wired for production, and a hardened permission system** — 86 commits since v0.7.0 (#580–#668) finish wiring the big subsystems end-to-end and graduate ClawCodex to 1.0. **Goal-directed autonomy:** the `/goal` + `/subgoal` completion-condition loop keeps the agent working until an LLM judge confirms the goal is actually met (#664), the new Monitor tool streams long-running shell output with backpressure (#665), background-bash completion notifications (#663), coordinator mode wired end-to-end on the live paths (#634), and `/advisor` token-efficient worker/reviewer pairing restored on the Ink TUI (#668). **Hooks live in production:** configured hooks now actually fire — bootstrap Hooks abstraction (#583), UserPromptSubmit (#597), multi-scope + lifecycle hooks (#595), `if` pre-filters (#643), PreToolUse `permissionDecision` (#655), PermissionRequest hooks at the ask seam (#637), MCP elicitation hooks (#659), and teammate TaskCompleted / TeammateIdle stop hooks (#642). **MCP completion:** OAuth server auth via the `/mcp` flow (#662), live `tools/list_changed` refresh (#598, #604), server instructions injected into the system prompt (#654), and `clawcodex mcp serve` re-exposes ClawCodex tools as an MCP stdio server (#635). **Permission hardening:** readable approval boxes with broadenable, persistent session grants (#608–#611), compound-command permission parity (#622), Bash normalization hardening (#626), `disableBypassPermissionsMode` lockdown (#660), an honest refuse-to-start unsandboxed guard (#658), subprocess secret-scrubbing (#650), and a flag-gated LLM security-classifier lane for auto mode (#589). **TUI maturity:** faithful Claude Code look & feel — diff rendering, tool-call transcript, task list, composer + permission-mode badge, busy line (#612–#616) — plus a minimal vim editing engine (#667), Esc-interrupt with a defanged Ctrl+C (#625), fully editable multi-line input (#621), slash-command argument hints (#631), a persistent session-stats line (#657), and restored `/cost`, `/skills`, and `/model` (#627, #629, #630). **Reliability:** the production compaction pipeline is wired and auto-compact actually applies its result (#587, #607), full retry lane + model fallback + message-history caching (#586), parallel Agent fan-out with the concurrency-cap deadlock fixed (#590), killing a background agent really stops the run (#606), and output styles work end-to-end (#640). Codebase stats: 1,170 Python files, **256,909 lines** (up from 233,520 lines on 2026-06-11). diff --git a/docs/i18n/README_ZH.md b/docs/i18n/README_ZH.md index e373c732..b5866bbb 100644 --- a/docs/i18n/README_ZH.md +++ b/docs/i18n/README_ZH.md @@ -63,6 +63,9 @@ python -m src.cli --dangerously-skip-permissions # 启动 REPL ## 📰 新闻 +- **2026-07-12(v1.1.0):** **ClawCodex v1.1.0 —— 用订阅方案运行 OpenAI 和 Claude 模型,而非按 API 计费** —— 1.1.0 的重头戏是**为两大模型家族提供订阅认证**,让你可以把 ClawCodex 接到你已经付费的方案上。**用 ChatGPT 登录(#698):** `clawcodex login → openai → subscription`(浏览器、设备码,或从已有的 Codex CLI 登录导入)通过 ChatGPT Codex 后端的 Responses API 路由请求 —— 在你的 Plus/Pro 额度内使用 `gpt-5.5`、`gpt-5.4`、`gpt-5.4-mini` 与 `gpt-5.3-codex-spark`,跨轮次重放加密推理,计费为 **$0**。**Claude Pro/Max(#697):** `clawcodex login → anthropic → subscription` 通过 OAuth(PKCE)连接 Claude 订阅,自动刷新 token,同样按 $0 计账;后续修复了 Anthropic 将 OAuth 端点迁移到 `platform.claude.com` 后的登录(#702),并停止向不支持自适应思考(adaptive thinking)的模型发送该参数(#699)。已配置的 API key 始终优先,订阅用量报告为 `billing_mode: subscription`。**更多模型:** 新增 Meta(`api.meta.ai`)provider 及 1M 上下文的 `muse-spark-1.1` 推理模型(#692),并刷新 MiniMax 参数(#696)。**工作流与 TUI:** `/plan` 模式及隐式 plan 模式进入/退出(#676)、`--worktree/-w` 会话隔离(在独立 git worktree 中并行运行,#672)、`/memory` 选择器 + `$EDITOR` 打开(#693)、配置/状态目录从 `.claude` 更名为 `.clawcodex` 并一次性迁移(#678)、`/logo` 启动配色(#677),以及 TUI 打磨 —— Tab 接受建议占位符(#690)、历史输入显示 Claude Code 高亮条(#691)、可点击的 agent URL(#694)、按终端适配的链接打开提示(#701)。**质量:** 语义化工具输入强制转换与对齐的校验错误信息(#700),以及更宽松、忠于 Claude Code 的权限授予(#673)。 +- **2026-07-07:** **`/loop` 定时任务现在真正触发 —— 完整移植 Claude Code 的会话级调度器(#680)** —— 内置的 `/loop` 技能终于有了真正的引擎:新的 `src/scheduled_tasks` 模块解析标准 5 字段 cron 表达式,并在 agent-server 空闲轮询时**在轮次之间**触发到期的提示。`CronCreate`/`CronList`/`CronDelete` 注册真正触发的任务(8 字符 ID、50 个任务上限、确定性抖动、7 天循环到期并最后触发一次),新的 **`ScheduleWakeup`** 工具驱动自定节奏的 `/loop` 模式 —— 模型自行挑选每次的下一个延迟(1 分钟–1 小时),`stop: true` 结束循环,约 20 分钟的回退唤醒兜底忘记重新调度的迭代。带类型的技能斜杠命令现在可达后端(新的 `skill_command` 控制),因此 `/loop 5m check ci` 可从 composer 键入运行,带补全与参数提示;TUI 显示实时倒计时指示(`⟳ loop wakeup in 2m 14s · ⏰ 1 scheduled`),且**空闲时按 Esc 停止等待中的循环**。`/clear` 丢弃会话任务,`--resume` 恢复未到期的任务,`CLAWCODEX_DISABLE_CRON=1` 禁用调度器。117 个新测试;已在 stdio NDJSON 与真实 PTY TUI 驱动下实测验证。 +- **2026-07-07:** **为 OpenAI 兼容流式传输的 ESC 取消块队列设置上限(#278)** —— `OpenAICompatibleProvider.chat_stream_response` 的工作线程队列(#148 引入)此前是无上限的 `queue.Queue`。当代理在 ESC 后仍持续发送字节(且从不关闭 SDK 迭代器)时,被孤立的工作线程会无限累积内存中的块。队列现在上限为 64 个块,队满后 `put()` 阻塞工作线程而非无限增长。 - **2026-07-06(v1.0.0):** **ClawCodex v1.0.0 —— 1.0 正式版:目标驱动的自主性、hooks 与 MCP 的生产级接线、强化的权限系统** —— 自 v0.7.0 以来的 86 个提交(#580–#668)完成了各大子系统的端到端接线,ClawCodex 正式升级到 1.0。**目标驱动的自主性:** `/goal` + `/subgoal` 完成条件循环让 agent 持续工作,直到 LLM 评审确认目标真正达成(#664);新的 Monitor 工具以带背压的方式流式输出长时间运行的 shell 日志(#665);后台 bash 完成通知(#663);coordinator 模式在生产路径端到端接通(#634);`/advisor` 省 token 的 worker/reviewer 搭档模式在 Ink TUI 上恢复(#668)。**Hooks 进入生产:** 配置的 hooks 现在真正生效 —— bootstrap Hooks 抽象(#583)、UserPromptSubmit(#597)、多作用域 + 生命周期 hooks(#595)、`if` 预过滤(#643)、PreToolUse `permissionDecision`(#655)、权限询问点的 PermissionRequest hooks(#637)、MCP elicitation hooks(#659),以及 teammate TaskCompleted / TeammateIdle 停止 hooks(#642)。**MCP 补全:** 通过 `/mcp` 流程完成 OAuth 服务器认证(#662)、`tools/list_changed` 实时刷新(#598、#604)、服务器说明注入系统提示词(#654),`clawcodex mcp serve` 将 ClawCodex 工具重新暴露为 MCP stdio 服务器(#635)。**权限强化:** 可读的批准框与可扩展的持久会话授权(#608–#611)、复合命令权限对齐(#622)、Bash 归一化强化(#626)、`disableBypassPermissionsMode` 锁定(#660)、诚实的拒绝启动无沙箱守卫(#658)、子进程密钥擦除(#650),以及 auto 模式下由 flag 控制的 LLM 安全分类器通道(#589)。**TUI 成熟度:** 忠实还原 Claude Code 的观感 —— diff 渲染、工具调用记录、任务列表、composer + 权限模式徽章、busy 行(#612–#616)——外加精简的 vim 编辑引擎(#667)、Esc 中断 + 去武装的 Ctrl+C(#625)、完全可编辑的多行输入(#621)、斜杠命令参数提示(#631)、常驻会话统计行(#657),以及恢复的 `/cost`、`/skills` 与 `/model`(#627、#629、#630)。**可靠性:** 生产压缩管线接通、auto-compact 真正应用其结果(#587、#607),完整重试通道 + 模型回退 + 消息历史缓存(#586),并行 Agent 扇出并修复并发上限死锁(#590),杀死后台 agent 会真正停止运行(#606),输出样式端到端可用(#640)。代码库统计:Python 文件 1,170 个,**256,909 行**(高于 2026-06-11 的 233,520 行)。 - **2026-06-30(v0.7.0):** **ClawCodex v0.7.0 —— TUI 自动主题、忠实的内联渲染与 Claude Code 风格的工具轨迹** —— Ink TUI 启动时会探测终端背景色(OSC 11)并自动匹配明/暗主题,任何终端上文字都清晰可读、无需环境变量(#577)。内联模式像 Claude Code 一样*真正*内联渲染:启动不清屏,启动时不与之前的终端输出重叠、退出时不与返回的 shell 提示符重叠(#573、#575)。工具轨迹采用 Claude 风格 —— 工作区相对路径(`Read(src/foo.ts)`)、`Grep(pattern)` 标签与 `Read N lines` 结果折叠(#574)——横幅新增 🦞 吉祥物,暗色主题下的次要文字更亮(#576)。 - **2026-06-24(v0.6.0):** **ClawCodex v0.6.0 —— 交互式 TUI REPL 对齐** —— 一批输入侧移植让 Python REPL 与 ink 参考实现对齐:可用的斜杠命令菜单(像 ink REPL 一样执行 / 补全 / 过滤)、带实时 token 数 + 已用时长忙碌行的星光 spinner、上下文感知的提示符底部提示(中断 / bash / 语法)、`?` 快捷键帮助面板、`@` 文件提及下拉框(原位拼接)、双击 Ctrl+C / Ctrl+D 退出、Ctrl+R 历史搜索 + 双击 Esc 清空草稿、`[Pasted text #N +K lines]` 大段粘贴占位符,以及完成的命令队列(排空排队的提示 + 暗色预览)。登录文档现在列出全部 25 个 provider(#383)。 @@ -70,9 +73,6 @@ python -m src.cli --dangerously-skip-permissions # 启动 REPL - **2026-06-21:** **新增 18 个 LLM provider —— 注册表从 7 增至 25(#377)** —— 数据驱动的 `ProviderSpec` 注册表在手写 provider 之外新增 18 个 OpenAI 兼容后端(nvidia-nim、fireworks、together、moonshot/Kimi、novita、siliconflow、deepinfra、stepfun、arcee、huggingface、volcengine、xiaomi-mimo、atlascloud、wanjie-ark,以及本地 ollama / vllm / sglang);支持别名感知的配置解析、标准环境变量密钥回退(如 `TOGETHER_API_KEY`)与免密钥的本地服务器。 - **2026-06-18:** **DeepSeek 前缀缓存利用 —— 巨大的 token 成本优势(#363)** —— ClawCodex 现在让请求前缀在多轮之间保持**字节级稳定**,使 DeepSeek 的自动 prompt 前缀缓存覆盖整个 `system + tools + history` 区段。每请求可变的部分(env、可变的 `MEMORY.md` 正文、plan 模式等)被移到对话历史*之后*的尾部 ``,即使 memory/env 变化也不会击穿缓存前缀。同时注册 DeepSeek 的 **1M token 上下文窗口**,把其 prompt 缓存用量映射到 Anthropic 的 `cache_read_input_tokens` 约定,并在 `/cost` 中展示每模型的**缓存命中率**与成本。**为什么意义重大 —— token 经济学:** Claude Fable 5 每 1M 输入/输出 token 收费 **$10 / $50**,而 **DeepSeek-V4-Pro 仅为 $0.435 / $0.87** —— 输入已**便宜约 23×**、输出**便宜约 57×**。由于**缓存命中的输入仅按正常输入价的 10% 计费**,agentic 编码实际产生的长上下文会话每 1M 输入 token 只需**约 $0.0435** —— 比 Fable 5 的输入**便宜约 230×**。ClawCodex 在这里解锁的 token 效率是**巨大的**。全部逻辑仅对 `deepseek` provider 生效 —— 其他 provider 的请求逐字节不变。后续修复:被截断的工具调用参数 JSON 现在会在共享的 OpenAI 兼容层尽力恢复,DeepSeek 流中断时保留部分工具参数而不是丢弃为 `{}`(#364)。 - **2026-06-16:** **Z.ai GLM-5.2 支持(#343)** —— 新增 `zai` provider,对接 Z.ai 的 OpenAI 兼容 GLM 编程套餐(`https://api.z.ai/api/coding/paas/v4`),提供 `GLM-5.1` 与 `GLM-5.2` 预览版;GLM-5.2 的编码能力可比肩 Claude Opus 4.7。首个用 GLM-5.2 端到端生成的应用——一个 [2026 世界杯介绍页](../../demos/wc26-intro/index.html)(动效首屏 + 实时倒计时、三个主办国、16 座球场、赛制说明与破纪录数据)。 -- **2026-06-11:** **代码库统计** —— Python 文件总数:1,093 个;Python 代码总行数:**233,520 行**(高于 2026-05-29 的 213,777 行;新增约 1.97 万行,主要来自交互式命令系统批次、动态 workflow 引擎 + `/deep-research`,以及 Tavily 网络工具链更新)。 -- **2026-06-10 至 2026-06-11:** **动态 workflow 引擎 + `/deep-research`(#262–#264、#266–#271)** —— Python workflow 引擎核心(`agent()`/`parallel()`/`pipeline()`/`phase()`、运行日志、断点恢复)完成端到端接线:Workflow 工具、`/workflows` TUI 对话框 + 状态栏指示、按 agent 重试、worktree 隔离、结果投递,以及注册为斜杠命令的内置 `/deep-research` 研究工作流。可靠性方面:LLM 读取超时统一应用到所有 openai 兼容 provider(#269),并行 agent 不再在事件循环上串行执行(#270),deep-research 的 synthesize 步骤禁用工具、避免报告撰写 agent 陷入循环(#271)。后续修复:workflow max-turns 上限修复(#272)、deep-research verdict 枚举修复(#273)、带阶段进度与各 agent 统计的 `/workflows` 实时监控(#287)。 -- **2026-06-10:** **Web 工具链更新(#265)** —— 用基于 Tavily 的 WebSearch 取代已失效的 DuckDuckGo 抓取,并新增基于配置文件的密钥存储;WebFetch 重写为确定性的 markdown/text/html 提取(借鉴 opencode)。 📚 更早的条目已移至完整的 **[News 归档](../NEWS.md)**。 diff --git a/install.sh b/install.sh index 6fb3a056..2ea343b3 100755 --- a/install.sh +++ b/install.sh @@ -48,7 +48,7 @@ trap 'log_err "Installer crash at line $LINENO: $BASH_COMMAND"' ERR # ============================================================================ # Config (read-only defaults) # ============================================================================ -readonly INSTALLER_VERSION="1.0.0" +readonly INSTALLER_VERSION="1.1.0" # REPO_REF is intentionally NOT readonly — it gets reassigned when the user # passes --ref. We have no version tags, so the default is the main branch; # --ref is the escape hatch for installing a specific commit/tag/branch. diff --git a/pyproject.toml b/pyproject.toml index 4821431b..ef87df63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "clawcodex" -version = "1.0.0" +version = "1.1.0" description = "A production-oriented Python rebuild of Claude Code — real architecture, reliable CLI agent" readme = "README.md" license = {text = "MIT"} diff --git a/src/__init__.py b/src/__init__.py index a7d13141..9c0df123 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1,6 +1,6 @@ """Claw Codex - Claude Code Python Implementation.""" -__version__ = "1.0.0" +__version__ = "1.1.0" __author__ = "Claw Codex Team" from .config import load_config, get_provider_config diff --git a/ui-tui/src/gatewayClient.ts b/ui-tui/src/gatewayClient.ts index 71cc77f4..850c762e 100644 --- a/ui-tui/src/gatewayClient.ts +++ b/ui-tui/src/gatewayClient.ts @@ -44,7 +44,7 @@ const RPC_TIMEOUT_MS = 5_000 const WORKTREE_RPC_TIMEOUT_MS = 600_000 // clawcodex app version shown in the banner ("clawcodex v{version}"). Keep in // sync with the installer (install.sh INSTALLER_VERSION). -const CLAWCODEX_VERSION = '1.0.0' +const CLAWCODEX_VERSION = '1.1.0' /** Command that launches the clawcodex agent-server (set by the Python launcher). */ function resolveAgentCmd(): string[] { diff --git a/uv.lock b/uv.lock index 2d51f790..905b6018 100644 --- a/uv.lock +++ b/uv.lock @@ -298,7 +298,7 @@ wheels = [ [[package]] name = "clawcodex" -version = "1.0.0" +version = "1.1.0" source = { editable = "." } dependencies = [ { name = "anthropic" }, @@ -309,11 +309,15 @@ dependencies = [ { name = "pathspec" }, { name = "pillow" }, { name = "prompt-toolkit" }, + { name = "pydantic" }, { name = "python-dotenv" }, { name = "pyyaml" }, + { name = "regex" }, { name = "rich" }, { name = "textual" }, { name = "tiktoken" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, + { name = "wcwidth" }, { name = "websockets" }, ] @@ -337,15 +341,19 @@ requires-dist = [ { name = "pathspec", specifier = ">=0.11" }, { name = "pillow", specifier = ">=10.0" }, { name = "prompt-toolkit" }, + { name = "pydantic", specifier = ">=2.0" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0.0" }, { name = "pytest-asyncio", marker = "extra == 'dev'", specifier = ">=1.3.0" }, { name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=5.0" }, { name = "python-dotenv" }, { name = "pyyaml", specifier = ">=6.0" }, + { name = "regex", specifier = ">=2023.0" }, { name = "rich" }, { name = "textual", specifier = ">=0.79" }, { name = "tiktoken", specifier = ">=0.7.0" }, { name = "twine", marker = "extra == 'dev'", specifier = ">=5.0.0" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'", specifier = ">=4.0" }, + { name = "wcwidth", specifier = ">=0.2" }, { name = "websockets", specifier = ">=14.0" }, ] provides-extras = ["dev"]