Skip to content

Add Write tool to sidebar agent and improve error visibility#584

Open
1aifanatic wants to merge 3 commits intogarrytan:mainfrom
1aifanatic:contribution-3-sidebar-agent
Open

Add Write tool to sidebar agent and improve error visibility#584
1aifanatic wants to merge 3 commits intogarrytan:mainfrom
1aifanatic:contribution-3-sidebar-agent

Conversation

@1aifanatic
Copy link
Copy Markdown

Summary

Fixes two issues with the sidebar agent: (1) missing Write tool prevents file creation, and (2) errors are invisible when Claude fails or returns empty.

Changes

  1. Add Write tool support:

    • Adds 'Write' to --allowedTools list in sidebar-agent.ts
    • Users can now create files (CSVs, logs, etc.) via sidebar agent
  2. Improve error visibility:

    • Captures stderr output instead of discarding it
    • Includes stderr in error messages for spawn errors and timeouts
    • Helps debug issues when Claude errors or returns empty output

Motivation

Previously, users asking to `write this to a CSV'' would silently fail because Write wasn't in allowedTools. And when the sidebar agent errored, users would just see a green dot forever with no indication of what went wrong.

Testing

  • TypeScript compiles without errors
  • Follows existing error handling patterns in the codebase

Closes TODOS.md item: Sidebar agent needs Write tool + better error visibility

Adds a new bin/gstack-open-url script that opens URLs in the default
browser across macOS, Linux, and Windows platforms.

- Uses 'open' on macOS
- Uses 'xdg-open' on Linux
- Uses 'start' on Windows
- Supports GSTACK_OPEN_CMD env override for custom handlers

This fixes the hardcoded 'open' command that only worked on macOS,
enabling the Boil the Lake and Search Before Building intro flows
to work on all supported platforms.

Closes TODOS.md item: Cross-platform URL open helper
Adds the first-time Search Before Building intro flow, similar to
the existing Boil the Lake intro.

Changes:
- Add generateSearchIntro() function that introduces the Search Before
  Building principle with a link to the essay
- Add SEARCH_INTRO preamble variable that checks for .search-intro-seen
- Update generateLakeIntro() to use the new gstack-open-url helper for
  cross-platform URL opening
- Add generateSearchIntro() to tier >= 3 preamble sections

This creates a consistent pattern for first-time principle introductions
and enables cross-platform browser opening for both intros.

Closes TODOS.md item: First-time Search Before Building intro
Fixes two issues with the sidebar agent:

1. Add Write tool support:
   - Adds 'Write' to --allowedTools list
   - Users can now create files (CSVs, logs, etc.) via sidebar agent

2. Improve error visibility:
   - Capture stderr output instead of ignoring it
   - Include stderr in error messages for spawn errors and timeouts
   - This helps debug issues when Claude errors or returns empty output

Previously, users asking to write files would silently fail, and
errors were invisible. Now both issues are surfaced properly.

Closes TODOS.md item: Sidebar agent needs Write tool + better error visibility
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