ur-agent 1.25.3 → 1.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/cli.js +5666 -4222
  2. package/docs/providers.md +193 -0
  3. package/package.json +1 -1
package/docs/providers.md CHANGED
@@ -59,6 +59,199 @@ ur config set base_url <url>
59
59
  ur config set provider.fallback ollama
60
60
  ```
61
61
 
62
+ ## Provider-scoped model selection
63
+
64
+ UR-AGENT shows only models available for the selected provider. This prevents selecting incompatible model/provider combinations.
65
+
66
+ ## Runtime provider routing
67
+
68
+ When you select a provider and model, all agent requests are routed through that provider's backend:
69
+
70
+ - **Subscription providers** spawn the official CLI command
71
+ - **API providers** make direct HTTP API calls with your API key
72
+ - **Local providers** connect to the configured local endpoint
73
+
74
+ The selected provider determines:
75
+ - Which backend receives your requests
76
+ - Which models are available
77
+ - How authentication works
78
+ - What error messages you see
79
+
80
+ **Important:** Ollama is only used when `ollama` is the selected provider. Selecting another provider routes all requests through that provider's backend.
81
+
82
+ ### `/model` command flow
83
+
84
+ When you run `/model` in the interactive agent, you get a **two-step provider-first selection**:
85
+
86
+ **Step 1: Provider Selection**
87
+
88
+ You see all configured providers with:
89
+ - Provider name (e.g., "ChatGPT/Codex", "OpenAI API", "Ollama")
90
+ - Access type: `subscription`, `api`, `local`, or `server`
91
+ - Connection status: `connected`, `missing`, `unavailable`, or `unknown`
92
+ - Credential type: `cli-login`, `api-key`, `local-runtime`, or `openai-compatible-endpoint`
93
+ - Short status message (e.g., "OPENAI_API_KEY found", "CLI not found", "localhost reachable")
94
+
95
+ **Step 2: Model Selection**
96
+
97
+ After selecting a provider:
98
+ - Only models from that provider are shown
99
+ - Each model shows its description
100
+ - Model source is displayed: `live` (dynamic discovery), `cache` (fallback), or `static` (predefined)
101
+ - Press Esc to go back and change provider
102
+
103
+ **Confirmation**
104
+
105
+ After selecting a model, the confirmation shows:
106
+ - Selected provider and access type
107
+ - Selected model name
108
+ - Model source (live/cache/static)
109
+ - Effort level (if applicable)
110
+ - Thinking status (if enabled)
111
+
112
+ **Example:**
113
+ ```
114
+ /model
115
+ → Step 1: Select provider
116
+ ChatGPT/Codex · subscription · connected
117
+ OpenAI API · api · OPENAI_API_KEY found
118
+ Ollama · local · localhost reachable
119
+
120
+ → Select: ChatGPT/Codex
121
+
122
+ → Step 2: Select model
123
+ gpt-4o · Most capable GPT-4 model
124
+ gpt-4o-mini · Fast and efficient variant
125
+ o1 · Reasoning model
126
+
127
+ → Select: gpt-4o
128
+
129
+ → Confirmation:
130
+ Provider: ChatGPT/Codex (subscription)
131
+ Model: gpt-4o
132
+ Source: static
133
+ ```
134
+
135
+ ### CLI workflow
136
+
137
+ ```sh
138
+ # 1. Select a provider
139
+ ur config set provider openai-api
140
+
141
+ # 2. View available models for that provider (in model picker)
142
+ /model
143
+
144
+ # 3. Select a model from the filtered list
145
+ ur config set model gpt-4o
146
+
147
+ # 4. Switch to a different provider - model list updates automatically
148
+ ur config set provider anthropic-api
149
+ # Now /model shows only Claude models, not GPT models
150
+ ```
151
+
152
+ ### Model discovery behavior
153
+
154
+ | Provider type | Model discovery | Source label |
155
+ | --- | --- | --- |
156
+ | Subscription CLI (codex-cli, claude-code-cli, gemini-cli, antigravity-cli) | Static list of provider-specific models | static |
157
+ | API providers (openai-api, anthropic-api, gemini-api, openrouter) | Static list of provider-specific models | static |
158
+ | Local providers (ollama, lmstudio, llama.cpp, vllm) | Dynamic discovery from local server | live |
159
+ | OpenAI-compatible | Dynamic discovery from configured endpoint | live |
160
+
161
+ ### API vs Subscription distinction
162
+
163
+ **Subscription providers** require official CLI login:
164
+ - `codex-cli` — ChatGPT/Codex subscription via `codex login`
165
+ - `claude-code-cli` — Claude Code subscription via `claude auth login`
166
+ - `gemini-cli` — Gemini Code Assist enterprise login
167
+ - `antigravity-cli` — Antigravity subscription login
168
+
169
+ **API providers** require environment variable with API key:
170
+ - `openai-api` — requires `OPENAI_API_KEY`
171
+ - `anthropic-api` — requires `ANTHROPIC_API_KEY`
172
+ - `gemini-api` — requires `GEMINI_API_KEY`
173
+ - `openrouter` — requires `OPENROUTER_API_KEY`
174
+
175
+ **Local providers** require local runtime:
176
+ - `ollama` — localhost Ollama server
177
+ - `lmstudio` — LM Studio OpenAI-compatible server
178
+ - `llama.cpp` — llama.cpp server mode
179
+ - `vllm` — vLLM server
180
+
181
+ **Important:**
182
+ - A ChatGPT/Claude/Gemini subscription does NOT give API access
183
+ - An API key does NOT give subscription CLI access
184
+ - OpenAI API and Codex CLI are separate providers
185
+ - Claude API and Claude Code are separate providers
186
+ - Gemini API and Gemini CLI are separate providers
187
+
188
+ ### Validation
189
+
190
+ When you set a model that is incompatible with the current provider, UR-AGENT shows an error:
191
+
192
+ ```
193
+ Invalid model for current provider:
194
+ Selected provider: openai-api
195
+ Selected model: claude-sonnet-4-20250514
196
+ Error: Model "claude-sonnet-4-20250514" is not available for provider "openai-api".
197
+ Valid models for openai-api: gpt-4o, gpt-4o-mini, o1, o3-mini, gpt-4-turbo
198
+ Suggested: ur config set model gpt-4o
199
+ ```
200
+
201
+ When you change providers, UR-AGENT warns if the current model is incompatible:
202
+
203
+ ```
204
+ Warning: Current model "gpt-4o" is not available for provider "anthropic-api".
205
+ Valid models for anthropic-api: claude-sonnet-4-20250514, claude-opus-4-20250514, claude-3-5-sonnet-20241022, claude-3-haiku-20240307
206
+ After changing provider, run: ur config set model claude-sonnet-4-20250514
207
+ ```
208
+
209
+ ### Troubleshooting
210
+
211
+ **Check active provider and model:**
212
+ ```sh
213
+ # Show current configuration
214
+ ur config get provider
215
+ ur config get model
216
+
217
+ # Or use the status command
218
+ ur provider status
219
+ ```
220
+
221
+ **Provider shows "missing":**
222
+ - Install the official CLI: `brew install codex` or equivalent
223
+ - Run: `ur auth <provider>` to complete login
224
+
225
+ **Provider shows "unavailable":**
226
+ - Check API key: `echo $OPENAI_API_KEY`
227
+ - Check local server: `curl http://localhost:11434/api/tags`
228
+ - Run: `ur provider doctor <provider>` for detailed diagnostics
229
+
230
+ **Model not in list:**
231
+ - Verify provider is correct: `/provider`
232
+ - Check model belongs to provider (API models ≠ CLI models)
233
+ - For local providers, ensure server is running and model is pulled
234
+
235
+ **Requests going to wrong backend:**
236
+ - Verify selected provider: `ur config get provider`
237
+ - Change provider: `ur config set provider <provider-id>`
238
+ - The selected provider determines which backend receives requests
239
+ - Ollama is only used when `ollama` is the selected provider
240
+
241
+ **Dynamic discovery fails:**
242
+ - Local providers: check server is running at configured URL
243
+ - OpenAI-compatible: verify base_url and API key (if required)
244
+ - Fallback only to same provider's cached models (never other providers)
245
+
246
+ **Debug active runtime backend:**
247
+ ```sh
248
+ # Show detailed provider status
249
+ ur provider doctor
250
+
251
+ # Check which backend will be used
252
+ # After selecting provider, all requests go through that provider's backend
253
+ ```
254
+
62
255
  Provider config and doctor commands accept canonical IDs and common aliases:
63
256
 
64
257
  | Canonical ID | Accepted examples |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ur-agent",
3
- "version": "1.25.3",
3
+ "version": "1.27.1",
4
4
  "description": "UR-AGENT — autonomous engineering workflow engine (plan, execute, test, verify, document, benchmark, reproduce)",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.14",