Skip to content

fix(remote-questions): fire configured channels in interactive mode#3482

Merged
jeremymcs merged 1 commit intogsd-build:mainfrom
NilsR0711:fix/remote-questions-interactive-mode
Apr 4, 2026
Merged

fix(remote-questions): fire configured channels in interactive mode#3482
jeremymcs merged 1 commit intogsd-build:mainfrom
NilsR0711:fix/remote-questions-interactive-mode

Conversation

@NilsR0711
Copy link
Copy Markdown
Contributor

TL;DR

What: Telegram/Slack/Discord questions were never sent when GSD ran with a terminal UI.
Why: tryRemoteQuestions was gated behind if (!ctx.hasUI), so it was unreachable in interactive sessions.
How: Move the remote call before the hasUI guard — tryRemoteQuestions returns null when unconfigured, so the local UI fallback is unchanged.

What

  • src/resources/extensions/ask-user-questions.ts — move remote check before !ctx.hasUI guard
  • src/resources/extensions/gsd/tests/remote-questions.test.ts — regression test (source-level, verified red before fix)

Why

The setup test message (sent directly via the Telegram API during /gsd remote telegram) always worked. But when the agent called ask_user_questions, the tool checked ctx.hasUI first — and because GSD was running interactively, it went straight to the local TUI, never touching the remote channel.

// Before (broken):
if (!ctx.hasUI) {
    tryRemoteQuestions(...)  // only in headless mode
}
showInterviewRound(...)      // always runs in interactive mode

// After (fixed):
tryRemoteQuestions(...)      // always runs first if configured (no-op when not configured)
if (!ctx.hasUI) {
    return errorResult(...)  // headless without remote = error
}
showInterviewRound(...)      // fallback when remote not configured

How

One-line reorder. tryRemoteQuestions already returns null when resolveRemoteConfig() finds no configured channel, so unconfigured users see no behavior change. The dynamic import is cached by the module system — no startup overhead.

Closes #3480

Verified with AI.

tryRemoteQuestions was gated behind if (!ctx.hasUI), so Telegram/Slack/
Discord were never contacted when GSD ran with a terminal UI. The test
message sent during setup always worked (direct API call, no guard), which
made the feature appear configured but non-functional in practice.

Move the remote call before the hasUI guard so configured channels fire
regardless of UI availability. When no remote channel is configured,
tryRemoteQuestions returns null and the local UI is used as before.

Adds a source-level regression test asserting that tryRemoteQuestions is
called before the !ctx.hasUI branch.

Closes gsd-build#3480

Verified with AI.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

🟢 PR Risk Report — LOW

Files changed 2
Systems affected 0
Overall risk 🟢 LOW

@jeremymcs jeremymcs merged commit 2580e65 into gsd-build:main Apr 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Telegram remote questions seemingly inoperative

2 participants