Skip to content

Commit b3e2d80

Browse files
authored
Merge pull request #128 from WecoAI/dev
Merge Dev - Add run subcommands + bump version (0.3.24)
2 parents f9ecfce + 4f00d0a commit b3e2d80

18 files changed

Lines changed: 1372 additions & 346 deletions

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,50 @@ For more advanced examples, including [Triton](/examples/triton/README.md), [CUD
186186

187187
| Command | Description | When to Use |
188188
|---------|-------------|-------------|
189-
| `weco run [options]` | Direct optimization execution | **For advanced users** - When you know exactly what to optimize and how |
189+
| `weco run [options]` | Start a new optimization | When you know what to optimize and how |
190190
| `weco resume <run-id>` | Resume an interrupted run | Continue from the last completed step |
191191
| `weco login` | Authenticate with Weco | First-time setup or switching accounts |
192-
| `weco logout` | Clear authentication credentials | To switch accounts or troubleshoot authentication issues |
192+
| `weco logout` | Clear authentication credentials | Switch accounts or troubleshoot auth |
193193
| `weco credits balance` | Check your current credit balance | Monitor usage |
194194
| `weco credits topup [amount]` | Purchase additional credits | When you need more credits (default: 10) |
195195
| `weco credits autotopup` | Configure automatic top-up | Set up automatic credit replenishment |
196196

197+
### Run Subcommands
198+
199+
Inspect and manage optimization runs. All output is JSON, designed for programmatic access (AI coding agents, scripts).
200+
201+
| Command | Description |
202+
|---------|-------------|
203+
| `weco run status <run-id>` | Run progress, pending nodes, review mode flag |
204+
| `weco run results <run-id>` | Results sorted by metric |
205+
| `weco run show <run-id> --step <N\|best>` | Single node detail with code |
206+
| `weco run diff <run-id> --step <N\|best>` | Unified code diff between steps |
207+
| `weco run stop <run-id>` | Graceful termination (tree preserved) |
208+
| `weco run instruct <run-id> "<text>"` | Update instructions mid-run |
209+
| `weco run review <run-id>` | List pending approval nodes (review mode) |
210+
| `weco run revise <run-id> --node <id> --source <file>` | Replace a node's code |
211+
| `weco run submit <run-id> --node <id>` | Evaluate and submit a node |
212+
213+
```bash
214+
# Check progress
215+
weco run status 0002e071-1b67-411f-a514-36947f0c4b31
216+
217+
# Top 5 results as JSON
218+
weco run results 0002e071-1b67-411f-a514-36947f0c4b31 --top 5
219+
220+
# Diff best solution against baseline
221+
weco run diff 0002e071-1b67-411f-a514-36947f0c4b31 --step best
222+
223+
# Review mode: inspect, optionally edit, and submit
224+
weco run review 0002e071-1b67-411f-a514-36947f0c4b31
225+
weco run submit 0002e071-1b67-411f-a514-36947f0c4b31 --node <node-id>
226+
227+
# Submit with your own code (explicit path mapping)
228+
weco run submit <run-id> --node <id> --source module.py=./my_version.py
229+
```
230+
231+
**Source path mapping:** When using `--source` with `revise` or `submit`, you can map local files to the run's source paths using `target_path=local_path` syntax (e.g., `--source module.py=./optimized.py`). Without an explicit mapping, files are matched positionally to the run's original source paths.
232+
197233
### Observe Commands
198234

199235
Track experiments from your own optimization loop (LLM agents, custom scripts, manual experiments) in the Weco dashboard:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name = "weco"
88
authors = [{ name = "Weco AI Team", email = "contact@weco.ai" }]
99
description = "Documentation for `weco`, a CLI for using Weco AI's code optimizer."
1010
readme = "README.md"
11-
version = "0.3.23"
11+
version = "0.3.24"
1212
license = { file = "LICENSE" }
1313
requires-python = ">=3.9"
1414
dependencies = [

tests/test_byok.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def base_params(self, mock_console):
3131
"search_policy_config": {"num_drafts": 2},
3232
}
3333

34-
@patch("weco.api.requests.post")
34+
@patch("weco.core.api.requests.Session.post")
3535
def test_api_keys_included_in_request(self, mock_post, base_params):
3636
"""Test that api_keys are included in the request JSON when provided."""
3737
mock_response = MagicMock()
@@ -54,7 +54,7 @@ def test_api_keys_included_in_request(self, mock_post, base_params):
5454
assert "api_keys" in request_json
5555
assert request_json["api_keys"] == {"openai": "sk-test-key", "anthropic": "sk-ant-test"}
5656

57-
@patch("weco.api.requests.post")
57+
@patch("weco.core.api.requests.Session.post")
5858
def test_api_keys_not_included_when_none(self, mock_post, base_params):
5959
"""Test that api_keys field is not included when api_keys is None."""
6060
mock_response = MagicMock()
@@ -75,7 +75,7 @@ def test_api_keys_not_included_when_none(self, mock_post, base_params):
7575
request_json = call_kwargs.kwargs["json"]
7676
assert "api_keys" not in request_json
7777

78-
@patch("weco.api.requests.post")
78+
@patch("weco.core.api.requests.Session.post")
7979
def test_api_keys_not_included_when_empty_dict(self, mock_post, base_params):
8080
"""Test that api_keys field is not included when api_keys is an empty dict."""
8181
mock_response = MagicMock()
@@ -105,7 +105,7 @@ def mock_console(self):
105105
"""Create a mock console for testing."""
106106
return MagicMock(spec=Console)
107107

108-
@patch("weco.api.requests.post")
108+
@patch("weco.core.api.requests.Session.post")
109109
def test_api_keys_included_in_suggest_request(self, mock_post, mock_console):
110110
"""Test that api_keys are included in the suggest request JSON when provided."""
111111
mock_response = MagicMock()
@@ -135,7 +135,7 @@ def test_api_keys_included_in_suggest_request(self, mock_post, mock_console):
135135
assert "api_keys" in request_json
136136
assert request_json["api_keys"] == {"openai": "sk-test-key"}
137137

138-
@patch("weco.api.requests.post")
138+
@patch("weco.core.api.requests.Session.post")
139139
def test_api_keys_not_included_in_suggest_when_none(self, mock_post, mock_console):
140140
"""Test that api_keys field is not included in suggest request when api_keys is None."""
141141
mock_response = MagicMock()
@@ -163,7 +163,7 @@ def test_api_keys_not_included_in_suggest_when_none(self, mock_post, mock_consol
163163
request_json = call_kwargs.kwargs["json"]
164164
assert "api_keys" not in request_json
165165

166-
@patch("weco.api.requests.post")
166+
@patch("weco.core.api.requests.Session.post")
167167
def test_api_keys_not_included_in_suggest_when_empty_dict(self, mock_post, mock_console):
168168
"""Test that api_keys field is not included in suggest request when api_keys is None."""
169169
mock_response = MagicMock()

0 commit comments

Comments
 (0)