Skip to content

feat(local): add check-stalled command and stage timeout - #1171

Open
shengzhaowei wants to merge 1 commit into
Tencent:mainfrom
shengzhaowei:feat/stage-stall-check
Open

shengzhaowei wants to merge 1 commit into
Tencent:mainfrom
shengzhaowei:feat/stage-stall-check

Conversation

@shengzhaowei

Copy link
Copy Markdown

What changed

local/skills/devflow/config/workflow.json has max_stage_failures: 2 but no stage timeout at all, and status never reports how long an in_progress stage has been running, so a stuck stage waits silently — Hermes delegate_task waits for a completion notice and Pi front-blocking waits for a return. This PR adds a reporting-only stall check, deliberately as a new standalone subcommand so it does not touch status or approve: (1) config/workflow.json: "stage_timeout_minutes": 60 (default for reporting only, not a kill switch; version stays 2.0). (2) scripts/workflow_state.py: new check-stalled command. For each in_progress stage with a started_at it prints one line with the elapsed minutes and flags stages over the timeout as STALLED. It exits 1 if any stage is stalled, else 0. It writes no state and triggers no abort or retry. A stage with no started_at prints elapsed=unknown and is not flagged. (3) A regression test (LifecycleTests.test_check_stalled_flags_stage_over_timeout) runs the command on a freshly started stage (exit 0, no STALLED), then backdates its started_at by 2 hours and asserts exit 1 with STALLED in the output.

Scope

Portable (checked); all other scope boxes unchecked, including Documentation only.

Compatibility

New subcommand and one new config key; no existing command, field, or behavior changes. No migration, no version bump. Old states without the new key still work because the timeout is read from config at run time.

Validation

Run locally on 2026-11-21, base d58a85a: validate_config OK (adapters=7 logical_roles=10 host_agents=6 artifacts=11); unittest 31 tests OK (incl. test_check_stalled_flags_stage_over_timeout); validate.sh [1/6]-[6/6] passed; build-classic-hosts.py --check OK; scan-secrets no leaks found; e2e tests passed (skipped=1); smoke-install passed; test-observability passed, source tree clean. Not run: go test, go vet, check-public.py — no Go or public-surface changes in this PR.

Safety

All four safety boxes checked: no credentials/internal endpoints/production data/organization-specific infrastructure; preserved user files and unrelated changes; updated generated Classic host bundles when applicable; documented third-party content and licensing changes when applicable.

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