Skip to content

fix(agents): check step status before starting work to avoid orphaned sessions#11

Open
paralizeer wants to merge 12 commits intomainfrom
auto/fix/session-kill-1772900053
Open

fix(agents): check step status before starting work to avoid orphaned sessions#11
paralizeer wants to merge 12 commits intomainfrom
auto/fix/session-kill-1772900053

Conversation

@paralizeer
Copy link
Copy Markdown
Owner

When a step is manually failed via 'antfarm step fail', the associated agent session continues running until the 60-minute timeout. This burns tokens unnecessarily.

This fix adds a status check at the start of agent work:

  1. Added 'antfarm step status' CLI command to get step status
  2. Added getStepStatus() function to step-ops.ts
  3. Updated agent prompts to verify step is still 'running' before doing work - if the step is failed/pending/done, the agent exits

This addresses issue snarktank#225 by having agents self-terminate when their step is no longer valid, rather than relying on session timeout.

Auto-generated by Openclaw AutoDev
Refs: snarktank#225

Claw and others added 12 commits March 6, 2026 12:44
Add dryRunWorkflow() function that:
- Validates workflow YAML via loadWorkflowSpec()
- Builds execution context with placeholder values
- Resolves all step input templates using resolveTemplate()
- Prints execution plan showing all steps with agent assignments
- Returns without creating DB entries or spawning crons

Update CLI to call dryRunWorkflow when --dry-run flag is passed to
'workflow run' command.

Tested with coding-sprint and bug-fix workflows.
- Add safety reset in claimStep: if step is running but has no current_story_id, reset to pending
- Add current_story.* context keys for template usage
- Set defaults for reviewer template keys (commit, test_result)
- Add logging to checkLoopContinuation for debugging
- Update all workflow YAMLs from 'default' to 'minimax/MiniMax-M2.5'
- Add memory access to developer/planner/reviewer/tester agents
- Add new prospector workflows: eps-prospector, local-prospector, job-scout, gran-concepcion-prospector

Addresses: snarktank#272 (story loop stuck), snarktank#266 (stall after Story 1)
Auto-generated by Openclaw AutoDev
The workflow YAMLs were updated to use 'minimax/MiniMax-M2.5' instead
of 'default' (commit 021244b), but the tests still expected 'default'.
This caused 4 test failures in the polling configuration tests.

Updated test expectations in:
- tests/bug-fix-polling.test.ts
- tests/feature-dev-polling.test.ts
- tests/security-audit-polling.test.ts
- tests/polling-timeout-sync.test.ts

Auto-generated by Openclaw AutoDev
Auto-generated by Openclaw AutoDev
- Added 'test' script to run Node.js built-in test runner
- Added 'typecheck' script for TypeScript type checking
- Enables npm test && npm run typecheck for CI/CD

Auto-generated by Openclaw AutoDev
The developer agent was exiting sessions without calling 'antfarm step
complete', causing steps to get stuck in 'running' state for 30+ minutes
until Medic reset them.

This fix adds explicit, highlighted instructions to the developer's
AGENTS.md emphasizing that:
1. step complete MUST be called after finishing work
2. Provides the exact command syntax to use
3. Explains that a fresh session will handle the next story

Fixes: snarktank#272
- Use minimax/MiniMax-M2.5 instead of 'default' model
- Simplify prompt to reduce token usage
- Make HEARTBEAT_OK response more explicit

Auto-generated by Openclaw AutoDev
Adds a GitHub Actions workflow that runs:
- npm run typecheck (TypeScript validation)
- npm test (all 162 tests)
- npm run build

This provides an alternative CI check to Vercel for PR validation.

Auto-generated by Openclaw AutoDev
…narktank#139)

- Added bot review check: reviewer must check for existing AI bot reviews
  (Copilot, Gemini, etc.) before approving a PR
- Added auto-merge on approval: after approving, merge via gh pr merge
- Both feature-dev and coding-sprint workflows updated

The reviewer now:
1. Checks for existing bot reviews (gh pr view --json reviews)
2. Addresses or acknowledges bot comments before approving
3. Auto-merges the PR after approval (feature-dev only)

This completes issue snarktank#139 - reviewer now handles bot review comments
and automatically merges approved PRs.

Auto-generated by Openclaw AutoDev
Refs: snarktank#139
… sessions

When a step is manually failed via 'antfarm step fail', the associated
agent session continues running until the 60-minute timeout. This burns
tokens unnecessarily.

This fix adds a status check at the start of agent work:
1. Added 'antfarm step status' CLI command to get step status
2. Added getStepStatus() function to step-ops.ts
3. Updated agent prompts to verify step is still 'running' before
   doing work - if the step is failed/pending/done, the agent exits

This addresses issue snarktank#225 by having agents self-terminate when their
step is no longer valid, rather than relying on session timeout.

Auto-generated by Openclaw AutoDev
Refs: snarktank#225
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