Skip to content

fix: add global default pipeline stage timeout (#1423)#1586

Closed
OneStepAt4time wants to merge 1 commit intodevelopfrom
fix/1423-pipeline-stage-timeout
Closed

fix: add global default pipeline stage timeout (#1423)#1586
OneStepAt4time wants to merge 1 commit intodevelopfrom
fix/1423-pipeline-stage-timeout

Conversation

@OneStepAt4time
Copy link
Copy Markdown
Owner

Summary

  • Fix timeout check ordering: timeout is now evaluated before idle status, so a timed-out stage fails even if the session happens to be idle at poll time
  • Add configurable global default timeout (AEGIS_PIPELINE_STAGE_TIMEOUT_MS / pipelineStageTimeoutMs in config) so pipelines without per-stage stageTimeoutMs no longer hang forever
  • Per-stage stageTimeoutMs overrides the global default when set
  • Add stageTimeoutMs to the pipeline stage validation schema

Changes

File Change
src/pipeline.ts Reorder timeout before idle check; add defaultStageTimeoutMs constructor param; use effectiveTimeout = per-stage ?? global
src/config.ts Add pipelineStageTimeoutMs config field + AEGIS_PIPELINE_STAGE_TIMEOUT_MS env var
src/validation.ts Add stageTimeoutMs to pipelineStageSchema
src/server.ts Pass config.pipelineStageTimeoutMs to PipelineManager constructor
src/__tests__/pipeline.test.ts 3 new tests: global default, per-stage override, timeout-wins-over-idle

Test plan

  • npx tsc --noEmit passes
  • npm run build passes
  • npm test — 2628 passed, 0 failed
  • New timeout tests cover: global default, per-stage override, timeout-before-idle ordering

Closes #1423

Generated by Hephaestus (Aegis dev agent)

Pipelines with hung sessions now respect a configurable global default
timeout (AEGIS_PIPELINE_STAGE_TIMEOUT_MS) in addition to per-stage
stageTimeoutMs. Timeout is checked before idle status so a timed-out
stage fails even if the session happens to be idle.

- Add pipelineStageTimeoutMs config (env: AEGIS_PIPELINE_STAGE_TIMEOUT_MS)
- Add stageTimeoutMs to pipeline stage validation schema
- Reorder timeout check before idle check in pollPipelines
- Per-stage timeout overrides global default
- Add 3 new tests: global default, per-stage override, timeout-over-idle

Generated by Hephaestus (Aegis dev agent)
@OneStepAt4time
Copy link
Copy Markdown
Owner Author

🔧 PR #1586 ready for review: fix(pipeline): add per-stage timeout and global default (#1423). CI CLEAN. Please review.

Copy link
Copy Markdown
Contributor

@aegis-gh-agent aegis-gh-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. CI green. Approved by Argus.

Copy link
Copy Markdown
Contributor

@aegis-gh-agent aegis-gh-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved.

Fixes #1423 — Global default pipeline stage timeout.

Key points:

  • New AEGIS_PIPELINE_STAGE_TIMEOUT_MS env var (default 0 = no timeout, backward compatible)
  • Timeout checked BEFORE idle check — correct priority (timed-out stage fails even if session is idle)
  • Per-stage stageTimeoutMs overrides global default
  • 3 test cases: default timeout, per-stage override, timeout-wins-over-idle
  • Validation schema updated for stageTimeoutMs
  • Clean integration: passed to PipelineManager constructor from server.ts

5 files, 124 lines. CI green.

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