Skip to content

fixed jobs marked as applied during dry run - #104

Open
jomylak wants to merge 1 commit into
Pickle-Pixel:mainfrom
jomylak:fix/dry-run-marks-jobs-applied
Open

jomylak wants to merge 1 commit into
Pickle-Pixel:mainfrom
jomylak:fix/dry-run-marks-jobs-applied

Conversation

@jomylak

@jomylak jomylak commented Sep 1, 2026

Copy link
Copy Markdown

--dry-run is documented as "Preview actions without submitting", but a dry run currently records the job as submitted.

The dry-run prompt instructs the agent to "Do NOT click the final Submit/Apply button ... then output RESULT:APPLIED with a note that this was a dry run" (prompt.py). run_job matches on RESULT:APPLIED and returns "applied", and worker_loop writes that straight to the database. dry_run is threaded through every signature but is never changed again once run_job returns, so the preview basically marks it the same as a real submission.

This fix makes a dry run leave the job untouched: the lock is released, nothing is persisted, and the outcome is still surfaced in the dashboard so the run is visible without being recorded.

Reproduce with applypilot apply --url <job> --dry-run, then check SELECT apply_status, applied_at FROM jobs WHERE url = '<job>'.

`--dry-run` is documented as "Preview actions without submitting", but a dry
run currently records the job as submitted.

The dry-run prompt instructs the agent to "Do NOT click the final Submit/Apply
button ... then output RESULT:APPLIED with a note that this was a dry run"
(prompt.py). run_job matches on `RESULT:APPLIED` and returns "applied", and
worker_loop writes that straight to the database. `dry_run` is threaded through
every signature but is never consulted again once run_job returns, so the
preview is indistinguishable from a real submission.

The result is silent and not recoverable through the CLI:

- mark_result sets apply_status='applied' and applied_at
- acquire_job only selects `apply_status IS NULL OR apply_status = 'failed'`,
  so the job is never offered again
- reset_failed explicitly excludes 'applied', so --reset-failed can't clear it

A rehearsal therefore consumes a real application permanently, and the job is
reported in the dashboard totals as applied.

This makes a dry run leave the job untouched: the lock is released, nothing is
persisted, and the outcome is still surfaced in the dashboard so the run is
visible without being recorded.

Reproduce with `applypilot apply --url <job> --dry-run`, then check
`SELECT apply_status, applied_at FROM jobs WHERE url = '<job>'`.
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.

1 participant