Skip to content

Conversation

@newhook
Copy link
Owner

@newhook newhook commented Jan 27, 2026

Summary

When the orchestrator spawns a new zellij session, this change automatically:

  1. Spawns the control plane in the new session
  2. Displays a user notification with instructions on how to attach

Previously, control plane spawning and user notification were inconsistent when a new zellij session was created.

Changes

  • internal/zellij/zellij.go: Modified EnsureSession to return a boolean indicating whether a new session was created
  • internal/control/spawn.go: Added InitializeSession helper function that consolidates session + control plane initialization
  • cmd/work.go:
    • Added printSessionCreatedNotification to display attach instructions
    • Integrated InitializeSession in runWorkCreate for both --auto and regular paths
  • internal/tui/tui_plan.go: Extended planWorkCreatedMsg to carry session creation status
  • internal/tui/tui_plan_work.go: Integrated InitializeSession and updated status message to show attach command when new session created
  • internal/claude/runner.go: Updated all EnsureSession call sites to use new signature (ignoring return value where appropriate)

Issues Resolved

  • ac-yssc: zellij: when we spawn a new zellij session
    • ac-yssc.1: Modify EnsureSession to return created flag
    • ac-yssc.2: Create session initialization helper with control plane spawn
    • ac-yssc.3: Display user notification when new zellij session is spawned
    • ac-yssc.4: Update call sites to use new session initialization

Testing

  • Verified go build completes successfully
  • Verified go test ./... passes
  • Code review completed (w-1xe.review-1)

🤖 Generated with Claude Code

newhook and others added 4 commits January 27, 2026 09:16
Change zellij.EnsureSession() to return (bool, error) where the boolean
indicates whether a new session was created (true) or an existing session
was reused (false). This enables callers to take additional actions when
a session is first created, such as spawning the control plane.

Updated all call sites to handle the new return value.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Create a higher-level InitializeSession function that:
1. Ensures a zellij session exists using EnsureSession
2. Automatically spawns the control plane when a new session is created
3. Returns SessionInitResult with session creation info for display

This consolidates the session + control plane initialization logic.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a new zellij session is created (via InitializeSession), display
a notification to help users attach to the session:

CLI (co work create):
- Shows a prominent box with the session name and attach command
- Works for both regular and --auto workflows

TUI:
- Extended planWorkCreatedMsg with sessionCreated and sessionName fields
- Status bar shows attach command when new session is created

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
newhook and others added 2 commits January 27, 2026 09:35
Moved the InitializeSession call before the if flagAutoRun block,
eliminating the duplicate code that existed both inside and outside
the conditional branch.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The err variable is already in scope from the earlier CollectIssueIDsForAutomatedWorkflow
call and gets reassigned later by CreateWorkAsync, so using a separate sessionErr variable
was unnecessary.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@newhook newhook merged commit 0c2c33c into main Jan 27, 2026
3 checks passed
@newhook newhook deleted the feat/zellij-when-we-spawn-a-new-zellij-session branch January 27, 2026 14:39
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.

2 participants