Skip to content

Workflow runs and workflow codex-home sessions are never pruned (1.3 GB) #1275

Open

Description

@Juliusolsson05

packages/workflow-mcp fileWorkflowStore deletes only tombstones and candidate dirs; /workflows/runs/ (623 MB, 134 runs) and workflows/codex-home/sessions/ (576 MB rollouts + 110 MB sqlite) are outside debugRetention with no TTL. Severity P2.

Found by the Stage 3 C6 hunt; lines are origin/main 9c6e48f. Findings file: temp/quality-loop/hunt-c6.md.

🤖 Generated with Claude Code

Activity

  1. Juliusolsson05 commented on Sep 27, 2026

    @Juliusolsson05
    OwnerAuthor

    OWNER-APPROVED: finished workflow runs are kept 90 days; resumable runs are never deleted. Prefer infrequent deletion.
    Owner, 2026-09-27T07:33:05Z: "just make these for me, just keep the fixtures in, they are innocent enough. do not delete stuff often" (manager applied it).

  2. Juliusolsson05 commented on Sep 27, 2026

    @Juliusolsson05
    OwnerAuthor

    App follow-up (held under the owner's PR freeze)

    The package half is workflow-mcp#65 (deleteRun, trash rename, reclaim), which is merging now. The app half is ready on branch fix/workflow-run-retention (6441fd86, pushed), with no PR open, per the freeze (manager, 2026-09-27). Open it as a pointer-bump + app PR once the freeze lifts.

    What the branch does (plan: docs/plans/2026-09-26-workflow-run-retention.md):

    • src/main/workflows/workflowRetention.ts: prunes old workflow run lineages and their Codex rollouts, in ancestry order, through the package's deleteRun. The pass reports unreclaimed deletions (runsUnreclaimed) and retries them with reclaimDeletedRuns().
    • Owner policy (temp/manager/owner-decisions-2026-09-27.md, item 5): a finished lineage is kept 90 days (override with AGENT_CODE_WORKFLOW_RUN_TTL_DAYS), and a resumable run is never deleted.
    • A lineage is kept while any member is resumable, not only its leaf (round 6 c: the leaf rule deleted a cancelled parent the package still resumes).
    • The rollout prune fails closed on any unreadable kept journal (q64/q66).
    • Wired in createWorkflowService.ts; workflowRetention.test.ts covers the policy, the ordering, fail-closed and the any-member rule.

    Retention cost, ACCEPTED for the owner (manager-verify-c of wfm#65): a lineage that ever failed, was cancelled or was interrupted is kept forever, even after a resumed run completed it. Tightening that needs the package to refuse such resumes first. The app PR body must state this.

    Still owed when the PR opens:

    1. Bump packages/workflow-mcp to wfm#65's merge commit (the branch still pins b4b98f8d), and resync the lockfile if the manifest changed.
    2. Merge origin/main.
    3. Run 3 fresh reviews on the combined head; the app half has only had reviewer c (round 6).
    4. npx tsc -b (0 lines) and the retention suite.

    Follow-ups already filed: #1344, #1348.

    🤖 Generated with Claude Code

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

    bugSomething isn't workingclass:C6-unboundedUnbounded growthsev:P2Real bug with a workaroundtype:bugSomething works wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions