Interactive shell backgrounding fails with "Session ID is required for background operations"
What happened
While exercising current main, I reproduced a failure when backgrounding a shell execution through the same runtime path used by the interactive UI.
I used the built origin/main code in a clean worktree (5fc8fea8d762d67d3bff14d00307138faff0bca5) and ran a real shell command via ShellExecutionService.execute(...) using the same shape the interactive UI builds in useExecutionLifecycle:
- start from
config.getShellExecutionConfig()
- override
terminalWidth, terminalHeight, defaultFg, defaultBg
- do not add
sessionId
Then I called ShellExecutionService.background(pid) the same way the interactive UI does.
Observed output:
pid 16508
sessionIdInConfig null
background_error Session ID is required for background operations
Expected
Backgrounding an interactive shell execution should succeed and register the task normally.
Actual
It throws:
Session ID is required for background operations
Why this matters
The model-driven shell path appears to pass a sessionId explicitly, but the interactive UI path does not. That makes this look like a UI-specific regression rather than a generic shell backgrounding problem.
Likely area
packages/cli/src/ui/hooks/useExecutionLifecycle.ts
packages/core/src/services/shellExecutionService.ts
The interactive UI path appears to call ShellExecutionService.execute(...) without a sessionId, then later calls ShellExecutionService.background(pid).
Interactive shell backgrounding fails with "Session ID is required for background operations"
What happened
While exercising current
main, I reproduced a failure when backgrounding a shell execution through the same runtime path used by the interactive UI.I used the built
origin/maincode in a clean worktree (5fc8fea8d762d67d3bff14d00307138faff0bca5) and ran a real shell command viaShellExecutionService.execute(...)using the same shape the interactive UI builds inuseExecutionLifecycle:config.getShellExecutionConfig()terminalWidth,terminalHeight,defaultFg,defaultBgsessionIdThen I called
ShellExecutionService.background(pid)the same way the interactive UI does.Observed output:
Expected
Backgrounding an interactive shell execution should succeed and register the task normally.
Actual
It throws:
Why this matters
The model-driven shell path appears to pass a
sessionIdexplicitly, but the interactive UI path does not. That makes this look like a UI-specific regression rather than a generic shell backgrounding problem.Likely area
packages/cli/src/ui/hooks/useExecutionLifecycle.tspackages/core/src/services/shellExecutionService.tsThe interactive UI path appears to call
ShellExecutionService.execute(...)without asessionId, then later callsShellExecutionService.background(pid).