Skip to content

fix(opencode): detect fresh and rotated sessions#589

Open
aaronflorey wants to merge 1 commit intoasheshgoplani:mainfrom
aaronflorey:fix/opencode-session-rotation
Open

fix(opencode): detect fresh and rotated sessions#589
aaronflorey wants to merge 1 commit intoasheshgoplani:mainfrom
aaronflorey:fix/opencode-session-rotation

Conversation

@aaronflorey
Copy link
Copy Markdown
Contributor

Summary

  • keep fresh OpenCode launches unbound until a same-project session appears during the current startup window so agent-deck does not reopen an older conversation just because that directory has many historical sessions
  • allow an already-bound OpenCode pane to rotate to a newer same-project session when there was recent local pane activity, which lets in-pane /new pick up the new session without stealing a sibling tab's binding
  • add regression coverage for both bootstrap detection and recent-activity rotation, plus a debug log that explains when a rebind was triggered by recent local activity

Testing

  • go test ./internal/session -run OpenCode
  • go test ./internal/session (still has 2 pre-existing failures on this branch and on plain upstream/main: TestLifecycle_StoppedRestartedRunningError and TestStatusCycle_ShellSessionWithCommand)

Docs

  • no documentation changes needed

Keep new OpenCode launches unbound until a same-project session appears during the current startup window. This avoids reopening older conversations when a directory has many historical sessions.

Allow an existing binding to rotate when the pane shows recent local activity, so in-pane /new switches to the new session without stealing a sibling tab's session.
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