Skip to content

feat(staged): add command pipeline system#669

Open
matt2e wants to merge 1 commit intomainfrom
commands-lead-to-session
Open

feat(staged): add command pipeline system#669
matt2e wants to merge 1 commit intomainfrom
commands-lead-to-session

Conversation

@matt2e
Copy link
Copy Markdown
Contributor

@matt2e matt2e commented Apr 30, 2026

Summary

  • Add a persisted command pipeline for deterministic pre-AI session steps, including squash, rebase, push, AI handoff, and PR creation.
  • Wire pipeline execution, cancellation, recovery, events, and GitHub PR helpers through the Tauri backend.
  • Surface pipeline progress, stop controls, statuses, and rounded durations in the Staged session UI.

Tests

  • crates-fmt
  • crates-test
  • crates-lint
  • staged-ci
  • differ-ci

@matt2e matt2e requested review from baxen and wesbillman as code owners April 30, 2026 03:42
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d57d15883

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1065 to +1077
onRebaseBranch={() => {
const agents = isRemote ? REMOTE_AGENTS : agentState.providers;
const provider = getPreferredAgent(agents) ?? undefined;
commands
.rebaseBranch(branch.id, provider)
.catch((e) => notifyError('Rebase failed', e));
}}
onSquashCommits={() => {
const agents = isRemote ? REMOTE_AGENTS : agentState.providers;
const provider = getPreferredAgent(agents) ?? undefined;
commands
.squashCommits(branch.id, provider)
.catch((e) => notifyError('Squash failed', e));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep rebase/squash session launches queue-aware

This change bypasses sessionMgr.startOrQueueSession(...) and calls commands.rebaseBranch/commands.squashCommits directly, which removes the branch-level queueing behavior those actions previously had. When a branch already has a running session, these actions can now start immediately and run concurrent Git operations in the same worktree (instead of being queued), which can cause command failures or conflicting state. Please route these actions through the existing queue path (or add equivalent backend gating) so they do not run in parallel with active branch sessions.

Useful? React with 👍 / 👎.

Comment on lines +633 to +637
if let Err(e) = start_session(
ai_config,
store_for_status.clone(),
app_handle.clone(),
registry,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Mark session terminal when AI handoff startup fails

If start_session(...) fails after a pipeline handoff, this path only emits an error event but never transitions the DB row out of running or deregisters the cancel token. In that scenario (e.g., provider unavailable/invalid at handoff time), the frontend may clear UI state from the event, but persisted session state remains incorrectly running and can get stuck until later recovery. This error branch should perform the same terminal-state transition/cleanup as other failure paths.

Useful? React with 👍 / 👎.

Add pipeline-backed branch commands, persisted pipeline state, terminal output normalization, and session UI for deterministic pre-AI handoff steps.
@matt2e matt2e force-pushed the commands-lead-to-session branch from 7416bfc to 5d125c1 Compare April 30, 2026 10:38
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