Skip to content

fix(issue): [Bug]: /gsd discuss silently exits on cold-start: ensureDbOpen() runs after the milestone-presence guard#6167

Open
jeremymcs wants to merge 1 commit into
mainfrom
issue/5837-bug-gsd-discuss-silently-exits-on-cold-s-1778892815
Open

fix(issue): [Bug]: /gsd discuss silently exits on cold-start: ensureDbOpen() runs after the milestone-presence guard#6167
jeremymcs wants to merge 1 commit into
mainfrom
issue/5837-bug-gsd-discuss-silently-exits-on-cold-s-1778892815

Conversation

@jeremymcs
Copy link
Copy Markdown
Collaborator

@jeremymcs jeremymcs commented May 16, 2026

Summary

  • Hoisted ensureDbOpen(basePath) before deriveState() in showDiscuss() and verified with focused discuss-related tests (8 passing).

Verification

  • Completed in the repository worktree before push.

Related Issue

Repo

  • gsd-build/gsd-2

Branch

  • issue/5837-bug-gsd-discuss-silently-exits-on-cold-s-1778892815

Summary by CodeRabbit

  • Bug Fixes
    • Improved database initialization timing to ensure proper access to project configuration during workflow operations.

Review Change Stack

…bOpen() runs after the milestone-presence guard
@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: bfbcdde3-cd61-4e5b-beac-11a1ee5167bd

📥 Commits

Reviewing files that changed from the base of the PR and between 8906b64 and 3f72ccc.

📒 Files selected for processing (1)
  • src/resources/extensions/gsd/guided-flow.ts

📝 Walkthrough

Walkthrough

The PR moves the database initialization call in showDiscuss() to execute earlier in the function. Previously, ensureDbOpen() was called after deriveState(), causing the function to exit early on cold-start because the database was not yet open when checking for an active milestone.

Changes

Database Initialization Ordering

Layer / File(s) Summary
Early database open with basePath
src/resources/extensions/gsd/guided-flow.ts
ensureDbOpen(basePath) is called immediately after verifying a GSD project exists and before deriveState(), ensuring the database is initialized with the correct project path before the function attempts to read the active milestone state.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • gsd-build/gsd-2#6050: Related to database path initialization; the earlier ensureDbOpen(basePath) call ensures the correct DB path is available as a prerequisite for WSL-based pragma downgrades in schema initialization.

Poem

🐰 A rabbit hops through cold-start mist,
"Hoist the DB!" our coder insisted,
Before deriving state so bright,
Open the database right—
Now discuss flows, no longer missed!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the bug being fixed: moving ensureDbOpen() before the milestone-presence guard in the discuss command to prevent silent exits on cold-start.
Linked Issues check ✅ Passed The code changes implement the exact fix described in issue #5837: hoisting ensureDbOpen(basePath) to run before deriveState() in showDiscuss() to resolve the cold-start bug.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the cold-start bug in showDiscuss() described in #5837; no unrelated modifications are present in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue/5837-bug-gsd-discuss-silently-exits-on-cold-s-1778892815

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 — HIGH

Files changed 1
Systems affected 1
Overall risk 🟠 HIGH

Affected Systems

Risk System
🟠 high GSD Workflow
File Breakdown
Risk File Systems
🟠 src/resources/extensions/gsd/guided-flow.ts GSD Workflow

⚠️ 🟠 High risk — the following systems require verification before merge:

  • 🟠 GSD Workflow: verify GSD workflow state transitions end-to-end

⛔ 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: GSD Workflow. Verify:

1. verify GSD workflow state transitions end-to-end

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.

[Bug]: /gsd discuss silently exits on cold-start: ensureDbOpen() runs after the milestone-presence guard

1 participant