Skip to content

fix(workflow): bypass guided discuss for custom workflow bootstrap#6207

Open
markusdi wants to merge 1 commit into
gsd-build:mainfrom
markusdi:fix/custom-workflow-bootstrap-guard
Open

fix(workflow): bypass guided discuss for custom workflow bootstrap#6207
markusdi wants to merge 1 commit into
gsd-build:mainfrom
markusdi:fix/custom-workflow-bootstrap-guard

Conversation

@markusdi
Copy link
Copy Markdown

@markusdi markusdi commented May 16, 2026

Summary

Follow-up to #3188.

Custom workflow runs are driven by activeEngineId/activeRunDir and GRAPH.yaml, not by the standard milestone state. During bootstrap, a custom workflow can legitimately have no active milestone, but the no-active-milestone gates still route into guided milestone discussion via showSmartEntry() before the custom engine loop gets a chance to dispatch.

This PR:

  • detects non-dev custom workflow runs during auto bootstrap,
  • skips the guided discuss/no-active-milestone branches for those custom runs,
  • still preserves the existing deep-project setup exception,
  • adds a regression test proving custom workflow bootstrap continues without dispatching guided discuss when no active milestone exists.

Test plan

node --import ./src/resources/extensions/gsd/tests/resolve-ts.mjs \
  --experimental-strip-types \
  --test --test-name-pattern "custom workflow bootstrap: no active milestone" \
  src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts

Result locally:

# tests 1
# pass 1
# fail 0
npm run build:core

Result locally: build completed successfully.

Notes

Running the entire deep-project-auto-loop.test.ts file in this local environment still has unrelated existing model-policy fixture failures in other subtests (no candidate models). The new regression itself passes when run by name, and npm run build:core passes.

Summary by CodeRabbit

Bug Fixes

  • Custom workflows no longer trigger unintended auto-start guided flows when active.

Tests

  • Added test coverage validating that custom workflow initialization properly prevents guided flow execution.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 88c9fa9c-ce4e-429e-a0a5-67cb0ebb0ac2

📥 Commits

Reviewing files that changed from the base of the PR and between 74bba52 and 32f8007.

📒 Files selected for processing (2)
  • src/resources/extensions/gsd/auto-start.ts
  • src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts

📝 Walkthrough

Walkthrough

bootstrapAutoSession now detects active custom workflow runs via s.activeEngineId and extends two control-flow guards to prevent guided-flow entry (discussion start and safety-check fallback) during custom workflow runs. A test helper and new test case validate the behavior.

Changes

Custom Workflow Run Guard Logic

Layer / File(s) Summary
Custom workflow run guard conditions
src/resources/extensions/gsd/auto-start.ts
isCustomWorkflowRun is derived from s.activeEngineId (enabled when truthy and not "dev") and injected into the bootstrap guard that prevents the guided-flow "discuss" / start-new-milestone path. The same guard is extended to the later "unreachable safety check" fallback.
Custom workflow bootstrap test
src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts
makeLightRepo() helper creates a temporary Git repo with .gsd/milestones structure and initial commit. A new test case validates that bootstrapAutoSession for a custom engine with no active milestone completes without dispatching guided-discuss messages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

bug, test

Poem

🐰 When custom workflows bloom and thrive,
Guard the pathways, keep them alive!
No discuss when a custom run's near,
Tests confirm it, loud and clear.
Guard conditions shine, tests cheer! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: bypassing guided discuss for custom workflow bootstrap, which directly matches the core problem and solution described in the PR objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

🔴 PR Risk Report — CRITICAL

Files changed 2
Systems affected 1
Overall risk 🔴 CRITICAL

Affected Systems

Risk System
🔴 critical Auto Engine
File Breakdown
Risk File Systems
🔴 src/resources/extensions/gsd/auto-start.ts Auto Engine
src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts (unclassified)

⚠️ 🔴 Critical risk — the following systems require verification before merge:

  • 🔴 Auto Engine: validate auto-mode trigger conditions and loop termination

⛔ This PR should not be merged without executing this follow-up prompt.

Ask your coding agent to verify before submitting:

Review this PR for risks in: Auto Engine. Verify:

1. validate auto-mode trigger conditions and loop termination

Before modifying any code, assess the scope of this fix:

- Identify the root cause, not just the reported symptom.
- Search the codebase for other call sites, similar patterns, or duplicated logic that may share the same bug.
- List affected tests, documentation, and any downstream consumers that depend on the current behavior.
- Flag any changes that extend beyond the immediate file or function.

Report findings first. Then propose a fix scoped to the actual root cause, and wait for confirmation before applying changes outside the originally reported location.

💡 Have a Codex subscription? Get an independent second opinion: codex review --adversarial

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