add: solvent jobs — dedicated job management CLI#40
Conversation
New command with sub-commands for day-to-day job operations: solvent jobs [list] list recent jobs with status/topic/budget solvent jobs list --status=X filter by status solvent jobs show <id> full job detail + P&L + metrics solvent jobs events <id> event log for a job solvent jobs cancel <id> mark a job cancelled All sub-commands support --json for scripting. Replaces the old bare 'solvent retry' dispatch with a proper sub-command pattern. 26 tests cover helpers, all sub-commands, edge cases (missing job, already-done cancel), and CLI dispatch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SGjM79GJpSksy9wSSBa7e6
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SGjM79GJpSksy9wSSBa7e6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f55d9f0da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| print(f"Job {job_id} is already {current} — nothing to do.") | ||
| return | ||
|
|
||
| treasury.upsert_job(job_id, "cancelled") |
There was a problem hiding this comment.
Block cancelling paid jobs without refund
When this runs for a job in paid_pending_fulfill or in_progress, it overwrites the status with cancelled; I checked solvent/queue.py and the worker only claims awaiting_payment, in_progress, paid_pending_fulfill, and pending_quote, so a paid job can be removed from processing without delivery or the existing refund/failure path. Please disallow cancellation once revenue/payment exists, or route it through refund handling.
Useful? React with 👍 / 👎.
| prog="solvent jobs", | ||
| description="Inspect and manage SOLVENT jobs.", | ||
| ) | ||
| p.add_argument("--json", action="store_true", dest="as_json", help="output as JSON") |
There was a problem hiding this comment.
Accept --json after each jobs subcommand
Because --json is registered only on the parent parser, argparse requires it before the subcommand; the advertised/common forms solvent jobs list --json, solvent jobs show <id> --json, and solvent jobs events <id> --json exit with an unrecognized-arguments error. Add the flag to the subparsers or otherwise parse it so the documented scripting form works.
Useful? React with 👍 / 👎.
| (none) run the batch demo / interactive session | ||
| status live summary: balance, jobs, API key presence; --watch to auto-refresh | ||
| upgrade check for newer version on PyPI; --check exits 1 if outdated | ||
| jobs list/show/retry/cancel jobs (jobs --help for sub-commands) |
There was a problem hiding this comment.
Register the advertised jobs retry command
solvent jobs retry <id> is advertised here and in job_cmd.py's usage text, but the jobs parser only registers list, show, events, and cancel, with no retry dispatch branch; running it exits with invalid choice: 'retry'. This leaves the new dedicated jobs CLI unable to perform one of its promised management actions even though StageRunner.retry_job already exists.
Useful? React with 👍 / 👎.
Summary
solvent/job_cmd.pywith sub-command dispatch:list,show,events,cancelsolvent jobs/solvent jobs list— columnar table of recent jobs with status emoji, topic, budget, agesolvent jobs list --status=failed— filter by statussolvent jobs show <id>— full detail: customer, budget, P&L, metricssolvent jobs events <id>— timeline of stage events for a jobsolvent jobs cancel <id>— idempotent cancel (no-ops on already-done jobs)--jsonfor scripting__main__.pyassolvent jobsTest plan
python3 -m pytest tests/test_job_cmd.py -v→ 26 passedpython3 -m pytest -q→ 342 passed, 6 skippedsolvent jobson empty DB → "No jobs"solvent jobs list --json→ valid JSON arraysolvent jobs cancel <id>→ status changes to cancelled🤖 Generated with Claude Code
https://claude.ai/code/session_01SGjM79GJpSksy9wSSBa7e6
Generated by Claude Code