Skip to content

Commit dc6b387

Browse files
PierrunoYTclaude
andcommitted
Merge upstream main into pr1/provider-identity-primitives
- internal/tui: main's #1083 moved the model-picker switch decision into modelPickerSwitchOwner so the row's owner label and the switch agree. Port this branch's row-based comparison into that helper: it resolves the owner to a saved row, compares it with the active row (not the credential identities), and returns the resolved row name, which the switch then targets. The label and the switch keep sharing one decision. - internal/config: keep both sides' imports (credstore, notify, io), and keep both sides' appended writer tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 parents 83fa9eb + 4dc603f commit dc6b387

183 files changed

Lines changed: 14844 additions & 910 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44

55
<p align="center"><strong>A terminal coding agent you own.</strong></p>
66

7+
<p align="center">
8+
<a href="https://trendshift.io/repositories/70679?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-70679" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/70679/daily?language=Go" alt="Twigpine/zero | Trendshift" width="250" height="55"/></a>
9+
<a href="https://trendshift.io/repositories/70679?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-70679" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/70679/weekly?language=Go" alt="Twigpine/zero | Trendshift" width="250" height="55"/></a>
10+
<a href="https://trendshift.io/repositories/70679?utm_source=repository-badge&amp;utm_medium=badge&amp;utm_campaign=badge-repository-70679" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/repositories/70679" alt="Twigpine/zero | Trendshift" width="250" height="55"/></a>
11+
</p>
12+
713
<p align="center">
814
<a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-blue"></a>
9-
<img alt="Go 1.26.6+" src="https://img.shields.io/badge/Go-1.26.6+-00ADD8?logo=go&logoColor=white">
15+
<img alt="Go 1.26.9+" src="https://img.shields.io/badge/Go-1.26.9+-00ADD8?logo=go&logoColor=white">
1016
<img alt="25+ providers" src="https://img.shields.io/badge/providers-25+-34E2EA">
1117
<a href="https://discord.gg/CaQDS6wdFn"><img alt="Discord" src="https://img.shields.io/badge/Discord-join-5865F2?logo=discord&logoColor=white"></a>
1218
<br>
@@ -23,6 +29,70 @@ zero exec "fix the failing test in ./pkg"
2329
zero exec --output-format stream-json < turns.jsonl
2430
```
2531

32+
## Partners
33+
34+
<table align="center">
35+
<tr>
36+
<td align="center" width="150" height="80">
37+
<a href="https://twigpine.com">
38+
<picture>
39+
<source media="(prefers-color-scheme: dark)" srcset="https://twigpine.com/logo-dark.png">
40+
<img src="https://twigpine.com/logo.png" alt="Twigpine logo" width="72">
41+
</picture>
42+
</a>
43+
</td>
44+
<td align="center" width="150" height="80">
45+
<a href="https://mimo.mi.com">
46+
<img src="https://mimo.xiaomi.com/mimo-v2-pro/assets/logo.svg" alt="Xiaomi MiMo logo" width="136">
47+
</a>
48+
</td>
49+
<td align="center" width="150" height="80">
50+
<a href="https://novita.ai/">
51+
<picture>
52+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/novita-logo-dark.svg">
53+
<img src="docs/assets/novita-logo.svg" alt="Novita AI logo" width="136">
54+
</picture>
55+
</a>
56+
</td>
57+
<td align="center" width="150" height="80">
58+
<a href="https://concentrate.ai/">
59+
<picture>
60+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/concentrate-logo-dark.svg">
61+
<img src="docs/assets/concentrate-logo.svg" alt="Concentrate logo" width="64">
62+
</picture>
63+
</a>
64+
</td>
65+
<td align="center" width="150" height="80">
66+
<a href="https://exa.ai/">
67+
<picture>
68+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/exa-logo-dark.svg">
69+
<img src="docs/assets/exa-logo.svg" alt="Exa logo" width="110">
70+
</picture>
71+
</a>
72+
</td>
73+
</tr>
74+
<tr>
75+
<td align="center"><a href="https://twigpine.com"><strong>Twigpine</strong></a></td>
76+
<td align="center"><a href="https://mimo.mi.com"><strong>Xiaomi MiMo</strong></a></td>
77+
<td align="center"><a href="https://novita.ai/"><strong>Novita AI</strong></a></td>
78+
<td align="center"><a href="https://concentrate.ai/"><strong>Concentrate</strong></a></td>
79+
<td align="center"><a href="https://exa.ai/"><strong>Exa</strong></a></td>
80+
</tr>
81+
<tr>
82+
<td align="center" width="150" height="80">
83+
<a href="https://www.gmicloud.ai/">
84+
<picture>
85+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/gmi-cloud-logo-dark.svg">
86+
<img src="docs/assets/gmi-cloud-logo.svg" alt="GMI Cloud logo" width="120">
87+
</picture>
88+
</a>
89+
</td>
90+
</tr>
91+
<tr>
92+
<td align="center"><a href="https://www.gmicloud.ai/"><strong>GMI Cloud</strong></a></td>
93+
</tr>
94+
</table>
95+
2696
## Why Zero
2797

2898
- **Use the model you want.** Bring OpenAI, Anthropic, Gemini, Groq, OpenRouter,
@@ -76,7 +146,7 @@ irm https://raw.githubusercontent.com/Gitlawb/zero/main/scripts/install.ps1 | ie
76146

77147
### From source
78148

79-
Source builds require Go 1.26.6+.
149+
Source builds require Go 1.26.9+.
80150

81151
```bash
82152
git clone https://github.com/Gitlawb/zero.git
@@ -141,6 +211,7 @@ export GEMINI_API_KEY=...
141211
export AIMLAPI_API_KEY=...
142212
export LONGCAT_API_KEY=...
143213
export FIREWORKS_API_KEY=...
214+
export GMI_API_KEY=...
144215
export MINIMAX_API_KEY=...
145216
export MINIMAXI_API_KEY=...
146217
```
@@ -163,6 +234,12 @@ To configure Fireworks AI directly, run:
163234
zero providers setup fireworks --set-active
164235
```
165236

237+
To configure GMI Cloud directly, run:
238+
239+
```bash
240+
zero providers setup gmicloud --set-active
241+
```
242+
166243
MiniMax presets use the Anthropic-compatible endpoints for the global and China
167244
regions:
168245

@@ -321,7 +398,7 @@ zero context context-budget report
321398
zero repo-map deterministic repository map
322399
zero repo-info local repository summary
323400
zero search | find search local session history
324-
zero sessions inspect, resume, fork, and rewind sessions
401+
zero sessions inspect, resume, fork, rewind, and prune sessions
325402
zero spec manage spec-mode drafts
326403
zero specialist manage specialist subagents
327404
zero skills manage markdown instruction skills
@@ -339,6 +416,13 @@ zero update --check check for newer releases
339416
zero upgrade download, verify, and install the latest release
340417
```
341418

419+
Cron keeps the newest 1,000 run outcomes per job in `runs.jsonl`. Each new run
420+
atomically replaces the history with the retained tail; existing larger histories
421+
are trimmed on their next run. Archive the file before that run if you need older
422+
outcomes. This retention does not delete session directories or reset fire counts.
423+
Malformed records and legacy lines of 1 MiB or more are skipped when reading or
424+
compacting history; new records of that size are rejected.
425+
342426
## Extending Zero
343427

344428
### Project and personal instructions

‎README_ZH.md‎

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44

55
<p align="center"><strong>一个独属于你的终端编码智能体。</strong></p>
66

7+
<p align="center">
8+
<a href="https://trendshift.io/repositories/70679?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-70679" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/70679/daily?language=Go" alt="Twigpine/zero | Trendshift" width="250" height="55"/></a>
9+
<a href="https://trendshift.io/repositories/70679?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-70679" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/70679/weekly?language=Go" alt="Twigpine/zero | Trendshift" width="250" height="55"/></a>
10+
<a href="https://trendshift.io/repositories/70679?utm_source=repository-badge&amp;utm_medium=badge&amp;utm_campaign=badge-repository-70679" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/repositories/70679" alt="Twigpine/zero | Trendshift" width="250" height="55"/></a>
11+
</p>
12+
713
<p align="center">
814
<a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-blue"></a>
9-
<img alt="Go 1.26.6+" src="https://img.shields.io/badge/Go-1.26.6+-00ADD8?logo=go&logoColor=white">
15+
<img alt="Go 1.26.9+" src="https://img.shields.io/badge/Go-1.26.9+-00ADD8?logo=go&logoColor=white">
1016
<img alt="25+ providers" src="https://img.shields.io/badge/providers-25+-34E2EA">
1117
<a href="https://discord.gg/CaQDS6wdFn"><img alt="Discord" src="https://img.shields.io/badge/Discord-join-5865F2?logo=discord&logoColor=white"></a>
1218
<br>
@@ -21,6 +27,70 @@ zero exec "修复 ./pkg 中失败的测试"
2127
zero exec --output-format stream-json < turns.jsonl
2228
```
2329

30+
## 合作伙伴
31+
32+
<table align="center">
33+
<tr>
34+
<td align="center" width="150" height="80">
35+
<a href="https://twigpine.com">
36+
<picture>
37+
<source media="(prefers-color-scheme: dark)" srcset="https://twigpine.com/logo-dark.png">
38+
<img src="https://twigpine.com/logo.png" alt="Twigpine logo" width="72">
39+
</picture>
40+
</a>
41+
</td>
42+
<td align="center" width="150" height="80">
43+
<a href="https://mimo.mi.com">
44+
<img src="https://mimo.xiaomi.com/mimo-v2-pro/assets/logo.svg" alt="Xiaomi MiMo logo" width="136">
45+
</a>
46+
</td>
47+
<td align="center" width="150" height="80">
48+
<a href="https://novita.ai/">
49+
<picture>
50+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/novita-logo-dark.svg">
51+
<img src="docs/assets/novita-logo.svg" alt="Novita AI logo" width="136">
52+
</picture>
53+
</a>
54+
</td>
55+
<td align="center" width="150" height="80">
56+
<a href="https://concentrate.ai/">
57+
<picture>
58+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/concentrate-logo-dark.svg">
59+
<img src="docs/assets/concentrate-logo.svg" alt="Concentrate logo" width="64">
60+
</picture>
61+
</a>
62+
</td>
63+
<td align="center" width="150" height="80">
64+
<a href="https://exa.ai/">
65+
<picture>
66+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/exa-logo-dark.svg">
67+
<img src="docs/assets/exa-logo.svg" alt="Exa logo" width="110">
68+
</picture>
69+
</a>
70+
</td>
71+
</tr>
72+
<tr>
73+
<td align="center"><a href="https://twigpine.com"><strong>Twigpine</strong></a></td>
74+
<td align="center"><a href="https://mimo.mi.com"><strong>Xiaomi MiMo</strong></a></td>
75+
<td align="center"><a href="https://novita.ai/"><strong>Novita AI</strong></a></td>
76+
<td align="center"><a href="https://concentrate.ai/"><strong>Concentrate</strong></a></td>
77+
<td align="center"><a href="https://exa.ai/"><strong>Exa</strong></a></td>
78+
</tr>
79+
<tr>
80+
<td align="center" width="150" height="80">
81+
<a href="https://www.gmicloud.ai/">
82+
<picture>
83+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/gmi-cloud-logo-dark.svg">
84+
<img src="docs/assets/gmi-cloud-logo.svg" alt="GMI Cloud logo" width="120">
85+
</picture>
86+
</a>
87+
</td>
88+
</tr>
89+
<tr>
90+
<td align="center"><a href="https://www.gmicloud.ai/"><strong>GMI Cloud</strong></a></td>
91+
</tr>
92+
</table>
93+
2494
## 为什么选择 Zero
2595

2696
- **使用你想要的模型。** 支持 OpenAI、Anthropic、Gemini、Groq、OpenRouter、DeepSeek、Mistral、xAI、Qwen、Kimi、GitHub Models、Ollama、LM Studio、Atomic Chat,或任何 OpenAI/Anthropic 兼容端点。
@@ -57,7 +127,7 @@ irm https://raw.githubusercontent.com/Gitlawb/zero/main/scripts/install.ps1 | ie
57127

58128
### 从源码构建
59129

60-
源码构建需要 Go 1.26.6+。
130+
源码构建需要 Go 1.26.9+。
61131

62132
```bash
63133
git clone https://github.com/Gitlawb/zero.git
@@ -114,6 +184,7 @@ export OPENAI_API_KEY=sk-...
114184
export ANTHROPIC_API_KEY=...
115185
export GEMINI_API_KEY=...
116186
export LONGCAT_API_KEY=...
187+
export GMI_API_KEY=...
117188
```
118189

119190
要直接配置美团 LongCat(LongCat-2.0),运行:
@@ -122,6 +193,12 @@ export LONGCAT_API_KEY=...
122193
zero providers setup longcat --set-active
123194
```
124195

196+
要直接配置 GMI Cloud,运行:
197+
198+
```bash
199+
zero providers setup gmicloud --set-active
200+
```
201+
125202
对于本地模型,运行 Ollama、LM Studio 或 [Atomic Chat](https://atomic.chat) 桌面应用,
126203
然后使用 `zero setup` 或 `zero providers detect`。使用 Atomic Chat 时,请先加载模型并启用
127204
本地 OpenAI 兼容 API(默认地址为 `http://127.0.0.1:1337/v1`),再选择 `atomic-chat-local`。
@@ -226,7 +303,7 @@ zero context 上下文预算报告
226303
zero repo-map 确定性仓库映射
227304
zero repo-info 本地仓库摘要
228305
zero search | find 搜索本地会话历史
229-
zero sessions 检查、恢复、分叉和回滚会话
306+
zero sessions 检查、恢复、分叉、回滚和清理会话
230307
zero spec 管理规范模式草稿
231308
zero specialist 管理专业子智能体
232309
zero skills 管理 Markdown 指令技能

‎docs/INSTALL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe a version that is no longer on disk. Prefer `mise upgrade`.
153153
go install github.com/Gitlawb/zero/cmd/zero@latest
154154
```
155155

156-
This builds from source, so it needs Go 1.26.6+ and it does not go through the
156+
This builds from source, so it needs Go 1.26.9+ and it does not go through the
157157
release archives. Two consequences worth knowing before you pick it:
158158

159159
- On Linux you also need the sandbox helper, which is a separate binary and is
@@ -180,7 +180,7 @@ Build a local binary:
180180
go build -o zero ./cmd/zero
181181
```
182182

183-
Source builds require Go 1.26.6+.
183+
Source builds require Go 1.26.9+.
184184

185185
### Sandbox Helpers For Source Builds
186186

‎docs/MODEL_RPM.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Local per-model completion limits
2+
3+
Add `modelRPM` to the existing Zero config file:
4+
5+
```json
6+
{"modelRPM": {"gpt-4.1": 30, "claude-sonnet-4.5": 15}}
7+
```
8+
9+
Keys resolve through the model registry; custom IDs match exactly after trimming
10+
whitespace. Missing keys and zero mean unlimited. Negative limits and conflicting
11+
aliases are configuration errors. Project config may add or tighten a user cap,
12+
but cannot relax it. Changes take effect on the next Zero process start.
13+
14+
For `zero exec` and interactive agent turns, admission happens immediately before
15+
the wrapped turn session's `Stream`. N admissions fit in any sliding 60-second
16+
window; N+1 returns a local rate-limit error before entering that method. The
17+
error reports when a slot expires. Exec uses its existing provider-error exit
18+
code plus a local-limit hint. There is no sleep or hidden retry. Failed admitted
19+
requests still consume a slot.
20+
21+
Sessions and model switches share a limiter in one process. Separate processes
22+
have independent windows; restarting clears them. This is not an account-wide
23+
cap. It counts Stream admissions, not all HTTP requests: setup/prewarm,
24+
compaction, provider-internal retries, discovery and direct calls outside that
25+
boundary are not counted. No TPM, cost budgets, persistence, cross-process
26+
coordination or new runtime/Python dependency is introduced.

‎docs/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Zero.
66
## User Docs
77

88
- [Install](INSTALL.md)
9+
- [Local per-model completion limits](MODEL_RPM.md)
910
- [Update flow](UPDATE.md)
1011
- [OAuth logins and subscription-backed providers](oauth-subscriptions.md)
1112

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)