Skip to content

Replace ApplyCommonActions with ActionHandler interface#332

Open
peyton-alt wants to merge 2 commits intomainfrom
action-handler
Open

Replace ApplyCommonActions with ActionHandler interface#332
peyton-alt wants to merge 2 commits intomainfrom
action-handler

Conversation

@peyton-alt
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 14, 2026 00:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the session state-machine transition flow to replace the “apply common actions + return remaining actions” pattern with a session.ActionHandler interface, so strategy-specific side effects can be dispatched during transition application.

Changes:

  • Introduces session.ActionHandler + session.ApplyTransition(...) and updates tests accordingly.
  • Updates strategy.TransitionAndLog(...) to accept an ActionHandler and applies transitions + actions in one place.
  • Refactors manual-commit PostCommit/TurnEnd flows to use per-transition handlers and updates hook call sites to provide handlers (or NoOpActionHandler).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmd/entire/cli/strategy/strategy.go Updates the TurnEndHandler contract to provide a turn-end ActionHandler.
cmd/entire/cli/strategy/session_state.go Updates TransitionAndLog to accept an ActionHandler and call session.ApplyTransition.
cmd/entire/cli/strategy/session_state_test.go Adds coverage ensuring TransitionAndLog still applies phase changes even if the handler errors.
cmd/entire/cli/strategy/phase_postcommit_test.go Adjusts post-commit/turn-end tests to validate emitted actions via result.Actions and apply via ApplyTransition.
cmd/entire/cli/strategy/manual_commit_hooks.go Refactors PostCommit and turn-end dispatch into ActionHandler implementations.
cmd/entire/cli/session/phase.go Adds ActionHandler, NoOpActionHandler, and ApplyTransition to execute common + strategy actions.
cmd/entire/cli/session/phase_test.go Replaces ApplyCommonActions tests with ApplyTransition and handler-behavior tests.
cmd/entire/cli/hooks_claudecode_handlers.go Updates turn-end/session-stop transitions to pass an ActionHandler (strategy-provided or no-op).
cmd/entire/cli/hooks.go Updates session-start transition to pass session.NoOpActionHandler{}.

@peyton-alt peyton-alt marked this pull request as ready for review February 14, 2026 01:42
@peyton-alt peyton-alt requested a review from a team as a code owner February 14, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant