forge icon indicating copy to clipboard operation
forge copied to clipboard

🐛 Bug: Lightbulb chat icon doesn't create agent sessions outside git worktrees

Open namastex888 opened this issue 1 month ago • 2 comments

Summary

The lightbulb icon in the chat interface doesn't create agent sessions with the same flexibility as the Forge backend supports (agent-type tasks running directly in chosen branch without git worktree isolation).

Steps to Reproduce

  1. Click the lightbulb icon in the chat interface
  2. Attempt to spawn an agent session
  3. Observe that the agent is constrained by git worktree isolation

Expected Behavior

The lightbulb icon should create agent sessions that can run directly in the chosen branch (outside git worktrees), matching the functionality available via the Forge backend and CLI. This would provide the same capabilities as the Claude Code client or other providers.

Actual Behavior

The lightbulb icon creates sessions with git worktree constraints, forcing users to use the CLI for operations that should be available directly from the chat interface.

Environment Details

  • Component: Chat UI (lightbulb icon)
  • Related: Forge backend (supports agent-type tasks without worktree isolation)
  • Impact: Users must switch to CLI for certain operations instead of using the chat interface

Additional Context

The backend already has the necessary functionality (agent task type with skip_worktree option). The issue is specifically with how the chat UI lightbulb icon invokes agent sessions - it needs to be updated to leverage the existing backend capabilities.

This is preventing users from having a seamless experience where they can perform all operations directly from the chat interface without context-switching to the CLI.

namastex888 avatar Nov 20 '25 23:11 namastex888

Verification (2025-11-24): Code shows use_worktree: false at subGenieApi.ts:356. This issue may have been fixed. Needs retesting to confirm.

vasconceloscezar avatar Nov 24 '25 17:11 vasconceloscezar

Update (2025-11-24): Bug CONFIRMED. Investigation shows:

  • subGenieApi.createMasterGenieAttempt() correctly sets use_worktree: false (line 356)
  • BUT this function is never called
  • Instead, useAttemptCreation hook is used, which hardcodes use_worktree: true (line 27)
  • Comment at line 27 acknowledges "Genie Lamp uses false" but code doesn't implement it

Root cause: Lamp navigates to chat view without creating attempt, ChatPanel creates attempt using wrong hook.

Location: frontend/src/hooks/useAttemptCreation.ts:27

vasconceloscezar avatar Nov 24 '25 18:11 vasconceloscezar