Preserve completed run reports when runner shutdown fails

Open
#381 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #405 by @piotrekno1 — closed without merging
  • #412 by @piotrekno1 — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
57/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
django, python
Domain
backend, testing

Research direction

Start with execute_run() in secondshift/runs/orchestration/workflows.py and trace how the agent result, output collection, runner shutdown, and finish_run_step() interact. Read the existing workflow tests and add a case where the agent succeeds while runner shutdown retries fail. Done means the terminal result and report remain available, the cleanup failure is visible, and the session can still be retried or reaped.

Written by the indexing model from the issue text.

Description

code-review needs-design secondshift

Important. In execute_run() in secondshift/runs/orchestration/workflows.py, the agent can return its result and output collection can complete before stop_runner_session_step() runs. If shutdown exhausts its retries, control goes to the exception handler before finish_run_step() persists the result. A completed skill is then marked as a finishing failure, its report metadata is omitted, and result-dependent deliveries are skipped.

Persist the agent result even when shutdown fails, record a cleanup warning, and retain the ability to retry or reap the session. Add a test where the agent succeeds and the runner stop call keeps failing, then assert that the terminal result and report remain available and the cleanup failure is visible.

Dominant language
Python
Stars
1
Forks
1
Avg merge
1h 9m
Merged PRs (30d)
322

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from piotrekno1/second-shift

All issues in piotrekno1/second-shift

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.