Skip to content

Smoke driver: harden argv, sessions and loop stop order #43

Open

Description

@maceorichards

Follow-up from the #40 final review (correctness axis). All five are in smoke/drive.py.

  • Messages starting with - are parsed as CLI options. {msg} is a positional argument in every smoke/agents.json template, so a stand-in reply that begins with a Markdown bullet ("- Yes, approve") fails the turn with an unknown-option error. This is likely to hit the first real smoke run.
    • codex: put -- before {msg};
    • claude and cursor: check whether -- is accepted; if not, prefix or reject such messages.
  • Concurrent labels can lose a session id. send loads sessions.json, runs the agent for minutes, then writes the whole dict back. The atomic replace prevents corruption but not the lost update. Re-read and merge just before writing, or keep one file per label.
  • Sessions are keyed by label only, not by repo dir. Reusing a label with another <repo-dir> resumes a session from a different project, and claude's --resume then fails because sessions are stored per directory. Store the repo dir with the session and refuse a mismatch.
  • loop checks for a PR URL before checking for a failed turn. A turn marked .failed whose text still contains a PR URL exits 0. Check for failure first. Also reject a negative --max, which today skips every check and exits 2.
  • An unparseable claude output silently starts a new session. If the id can't be read, the next send starts fresh and loses the context. At least print a warning.

Each fix gets a test in tests/test_smoke_driver.py, using the existing fake CLIs on PATH.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions