The catch-all in checkReactions() silently swallowed auth failures
(401/403), making them indistinguishable from "no reaction yet". Now:
- 404: expected (no reactions for this emoji), continue
- 401/403: re-thrown so the poll loop surfaces the auth failure
- Other errors: best-effort skip (rate limits, network)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Error messages from adapter auth/send failures may contain token
fragments. Added sanitizeError() that strips Slack token patterns
(xoxb-, xoxp-, xoxa-) and long opaque secrets (20+ alphanumeric
chars). Also truncates verbose Discord API error responses to 200
chars. Applied to all error paths in manager.ts and discord-adapter.ts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Individual HTTP calls to Slack/Discord APIs could hang indefinitely
if the network stalls. The overall poll deadline only bounds the loop,
not each request. Now each fetch() gets AbortSignal.timeout(15_000).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Arbitrary-length free-text replies from remote channels were passed
directly into the LLM context. Now truncated to 500 chars with
trailing ellipsis.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Slack IDs must match ^[A-Z0-9]{9,12}$, Discord snowflakes must match
^\d{17,20}$. resolveRemoteConfig() and getRemoteConfigStatus() now
reject malformed IDs before they reach any URL interpolation.
Also fixes pre-existing false-positive in config tests (env overrides
couldn't affect module-level homedir() cache) — replaced with direct
isValidChannelId() unit tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Anthropic API rejects images exceeding 2000px in multi-image requests.
With deviceScaleFactor=2, viewport screenshots were 2560x1600px, triggering
400 errors that halted execution. Add scale:"css" to all API-facing screenshot
calls and a constrainScreenshot() fallback that downscales oversized images
(e.g. fullPage on tall pages) via the browser's canvas — zero new dependencies.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update buildResourceLoader to include ~/.pi/agent/extensions/ in
additionalExtensionPaths, allowing GSD to discover and use extensions
installed in pi's default location.
This resolves extension loading issues when users have extensions
installed in ~/.pi/agent/extensions/ instead of ~/.gsd/agent/extensions/.
- resource-loader.ts: add piExtensionsDir to additionalExtensionPaths
- app-smoke.test.ts: add test verifying the source includes .pi path
resolveRemoteConfig test used process.env.HOME which is undefined on
Windows (Node uses USERPROFILE). Use a temp directory with both HOME
and USERPROFILE set, and clean up in a finally block.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
getLatestPromptSummary() sorted JSON filenames alphabetically to find
the most recent prompt. Since filenames are UUIDs (random, not temporal),
this returned arbitrary results. Now reads updatedAt from each record
and picks the highest.
Also fixes test isolation on Windows (USERPROFILE) and adds a regression
test that fails with the old alphabetical sort.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Child processes (Git Bash/MSYS2) strip the ENABLE_VIRTUAL_TERMINAL_INPUT
flag from the shared stdin console handle, corrupting terminal input.
Re-enable the flag after every child process exits in bash.js, bg-shell,
and cache FFI handles in pi-tui for cheap repeated calls.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cli.ts unconditionally entered InteractiveMode, ignoring --mode, -p,
--no-session and other flags the subagent extension passes to child
processes. The child would wait for TTY input that never arrives
(stdin is "ignore"), causing the parent to hang forever on "working".
Parse CLI args to detect print/subagent mode and route to runPrintMode()
with proper session, model, extension, and system prompt handling.
Closes#45
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sessions are stored in a single flat ~/.gsd/sessions/ directory, so
/resume shows sessions from all projects regardless of which folder
you're in.
Use per-cwd subdirectories under ~/.gsd/sessions/ with the same
path encoding the upstream SDK uses (--path-segments--), so /resume
only lists sessions from the current working directory.
Node's --experimental-strip-types doesn't support parameter properties
(private readonly in constructor params). Convert to explicit field
declarations + constructor assignments.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The custom input handlers called tui.invalidate() which caused infinite
recursion. Rewrite promptMaskedInput and promptInput to use the Editor
component (same pattern as get-secrets-from-user.ts) with proper
tui.requestRender() and cache invalidation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pi's DefaultResourceLoader auto-discovers extensions/*/index.ts and
expects a default export factory. remote-questions is an internal
library (consumed via dynamic import), not an extension — having an
index.ts caused the loader to try loading it as one and fail.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When ask_user_questions is called in non-interactive mode (ctx.hasUI = false),
transparently route questions to a configured Slack or Discord channel and poll
for the user's response. Same tool interface, automatic routing.
- Add adapter pattern for Slack (Bot Token API) and Discord (HTTP API)
- Add /gsd remote command for interactive setup wizard
- Add SLACK_BOT_TOKEN / DISCORD_BOT_TOKEN to wizard and env hydration
- Add remote_questions config to GSD preferences with merge support
- Fix parseScalar to preserve large numeric IDs (Discord channel IDs)
- Show remote channel status on session_start
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- bg_shell killProcess: add Windows-specific taskkill /F /T /PID path
with proper error handling (spawnSync with timeout, not stdio: "ignore")
- bg_shell startProcess: use getShellConfig() instead of hardcoded "bash",
disable detached mode on Windows (process groups don't apply)
- GSD bash tool: wrap execute to inject 120s default timeout when the LLM
omits the timeout parameter, preventing indefinite hangs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- wizard.ts: also check for \b (0x08) which Windows terminals send for backspace
- browser-tools: read BROWSER_PATH env var and pass as executablePath to Playwright
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Non-execute-task and execute-task idle recovery now:
- Checks if the artifact already exists before steering (early advance)
- Escalates steering on final attempt ("last chance before skip")
- Writes blocker placeholder artifacts and advances the pipeline when
retries are exhausted, instead of pausing auto-mode silently
Closes#17
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Milestones completed before the roadmap convention (e.g. M001-M003)
have SUMMARY files but no ROADMAP. Previously these were treated as
incomplete, causing the first one to become the active milestone with
a fallback title like 'M001: M001'.
Now getActiveMilestoneId(), the completeMilestoneIds pre-computation,
and the deriveState() registry loop all check for a SUMMARY file when
no roadmap exists and mark the milestone as complete, extracting the
title from the summary H1.
Uses getAll() instead of getAvailable() so stale models like grok-2
are caught even when the user has no auth for the correct provider yet.
Resets thinking to off when the configured model was invalid.
- Remove gsd-pi from its own dependencies (circular dep caused ENOTEMPTY install failures)
- Auto-select anthropic/claude-sonnet-4-6 as default model for new installs
- Reset to valid model if configured model no longer exists in registry
- Default thinking level to off
When Tab opens the notes field, committed/checked options now stay
visually prominent (text color + muted description) while unselected
options dim. Previously Tab greyed everything out equally.
- optionUnselected: respect isCommitted when isFocusDimmed
- checkboxUnselected: respect isChecked for description color when isFocusDimmed
All prompt files under src/resources/extensions/gsd/prompts/ hardcoded
~/.pi/agent/extensions/gsd/templates/ but GSD overrides the agent
directory to ~/.gsd/agent/ in loader.ts. This caused all template reads
to fail silently — the agent never loaded formatting guidance.
Replaced all 26 occurrences across 16 files.
- All outward-facing GitHub tool actions now require user confirmation
via a themed yes/no dialog before executing (create, update, close,
reopen issues; create/update PRs; add comments; submit reviews;
request reviewers; create labels/milestones)
- New shared confirm-ui.ts component using the shared UI design system
- Read-only actions (list, view, search, diff, files, checks) ungated
- License changed from BUSL-1.1 to MIT
When no milestone exists, both /gsd and /gsd auto reach showSmartEntry
and call dispatchWorkflow — overwriting pendingAutoStart and restarting
the conversation mid-interview every time the user re-ran the command.
Add a pendingAutoStart check at the top of the !activeMilestone branch.
If a discuss session is already in progress, notify the user instead of
re-dispatching.
Fixes#6