fix: isolate scheduled task run contexts #111

Merged
nsaspy merged 1 commit from codex/issue-110 into main 2026-09-06 05:15:57 +00:00
Owner

Fixes #110.

What changed

  • create a unique persisted AgentContext for every scheduler occurrence
  • seed each run only with the current prompt, system prompt, explicit context/attachments, and the bounded previous successful terminal output
  • attest terminal output only after a non-empty response tool completes with break_loop enabled
  • fence result promotion by current_run_id so stale completions cannot overwrite newer state
  • preserve failures, cancellations, timeouts, and raw tool returns as last-run status without replacing the last successful handoff
  • persist and expose durable task ID, current/last run ID, last run status, previous successful run/output, SHA-256, byte count, and truncation state
  • keep legacy and historical chats while separating sidebar chat selection from durable task management

Verification

  • exact HEAD Prolog verification: passed
  • focused scheduler/API/tool/WebUI regressions: 59 passed
  • broad suite excluding independently reproduced baseline/environment failures: 1626 passed, 12 skipped, 12 deselected

Known unrelated baseline/environment failures

The unfiltered suite has 12 remaining failures: missing flaredantic and openpyxl in the Nix runtime, existing /a0 permission assumptions in rendered-prompt tests, the existing provider-mode default mismatch, and the installed CronTab rejecting the repository existing crontab keyword. No failing test touches this diff.

Fixes #110. ## What changed - create a unique persisted AgentContext for every scheduler occurrence - seed each run only with the current prompt, system prompt, explicit context/attachments, and the bounded previous successful terminal output - attest terminal output only after a non-empty response tool completes with break_loop enabled - fence result promotion by current_run_id so stale completions cannot overwrite newer state - preserve failures, cancellations, timeouts, and raw tool returns as last-run status without replacing the last successful handoff - persist and expose durable task ID, current/last run ID, last run status, previous successful run/output, SHA-256, byte count, and truncation state - keep legacy and historical chats while separating sidebar chat selection from durable task management ## Verification - exact HEAD Prolog verification: passed - focused scheduler/API/tool/WebUI regressions: 59 passed - broad suite excluding independently reproduced baseline/environment failures: 1626 passed, 12 skipped, 12 deselected ## Known unrelated baseline/environment failures The unfiltered suite has 12 remaining failures: missing flaredantic and openpyxl in the Nix runtime, existing /a0 permission assumptions in rendered-prompt tests, the existing provider-mode default mismatch, and the installed CronTab rejecting the repository existing crontab keyword. No failing test touches this diff.
nsaspy merged commit 1cb38213b6 into main 2026-09-06 05:15:57 +00:00
Sign in to join this conversation.
No description provided.