Skip to content

add: solvent jobs — dedicated job management CLI#40

Merged
ianalloway merged 2 commits into
mainfrom
claude/solvent-jobs
Jun 30, 2026
Merged

add: solvent jobs — dedicated job management CLI#40
ianalloway merged 2 commits into
mainfrom
claude/solvent-jobs

Conversation

@ianalloway

Copy link
Copy Markdown
Owner

Summary

  • New solvent/job_cmd.py with sub-command dispatch: list, show, events, cancel
  • solvent jobs / solvent jobs list — columnar table of recent jobs with status emoji, topic, budget, age
  • solvent jobs list --status=failed — filter by status
  • solvent jobs show <id> — full detail: customer, budget, P&L, metrics
  • solvent jobs events <id> — timeline of stage events for a job
  • solvent jobs cancel <id> — idempotent cancel (no-ops on already-done jobs)
  • All sub-commands support --json for scripting
  • Wired into __main__.py as solvent jobs

Test plan

  • python3 -m pytest tests/test_job_cmd.py -v → 26 passed
  • python3 -m pytest -q → 342 passed, 6 skipped
  • solvent jobs on empty DB → "No jobs"
  • solvent jobs list --json → valid JSON array
  • solvent jobs cancel <id> → status changes to cancelled

🤖 Generated with Claude Code

https://claude.ai/code/session_01SGjM79GJpSksy9wSSBa7e6


Generated by Claude Code

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
@ianalloway ianalloway marked this pull request as ready for review June 30, 2026 16:36
Copilot AI review requested due to automatic review settings June 30, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ianalloway ianalloway merged commit 58eee2f into main Jun 30, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread solvent/job_cmd.py
print(f"Job {job_id} is already {current} — nothing to do.")
return

treasury.upsert_job(job_id, "cancelled")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread solvent/job_cmd.py
prog="solvent jobs",
description="Inspect and manage SOLVENT jobs.",
)
p.add_argument("--json", action="store_true", dest="as_json", help="output as JSON")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread solvent/__main__.py
(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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants