Repository navigation
feat(launcher): background engagement lifecycle — --background, attach, engagements - #1049
Conversation
…h, engagements Implements the background engagement session lifecycle from #1041: - decepticon start --background: the full startup pipeline (verify Docker, select engagement, start services, wait for readiness) runs without attaching the interactive CLI. Prints the engagement name and attach hint, exits 0 with services kept running. - decepticon attach <name>: re-opens the interactive CLI against an existing engagement workspace — the same startup pipeline as start minus the picker. Supports --resume/--continue session selection. With no argument it lists available engagements. - decepticon engagements: lists engagement workspaces with Red-approval state. - engagementEntry is exported as engagement.EngagementEntry so the cmd package can render the list. The start --background flag is the first slice of the Claude Code --bg pattern applied to Decepticon's engagement semantics (an engagement resume, not a generic agent job). attach is the counterpart for re-entry. Addresses #1041 (first slice: detached start + attach + list; per-engagement logs and cancel follow as separate slices).
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11180725c0
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return err | ||
| } | ||
| ui.Info("Attaching to engagement " + slug + "…") | ||
| return runStartMode(cmd, nil, slug) |
There was a problem hiding this comment.
Separate attach from the service-only startup path
Every decepticon attach <name> passes the slug as existingEngagement, but runStartMode uses any nonempty value as the Desktop/service-only sentinel and returns at start.go:398-401 before constructing cliEnv or calling RunInteractive. Consequently attach only starts/checks the service and prints DECEPTICON_DESKTOP_ASSISTANT; it never opens the interactive CLI or applies --resume/--continue as advertised. Pass a distinct attach mode or separate engagement selection from the service-only condition.
Useful? React with 👍 / 👎.
| startCmd.Flags().BoolVar(&backgroundRun, "background", false, | ||
| "Start services and prepare the engagement without opening the interactive CLI; attach later with 'decepticon attach <name>'") |
There was a problem hiding this comment.
Record the new lifecycle in CHAGELOG.md
This adds the user-visible start --background, attach, and engagements surfaces without an Unreleased entry in the single root CHAGELOG.md. The repository explicitly requires every PR to record user-visible changes and compatibility notes there, so add the proposed change and PR link before merging.
AGENTS.md reference: AGENTS.md:L3-L8
Useful? React with 👍 / 👎.
| Example: ` decepticon attach my-engagement | ||
| decepticon attach my-engagement --continue | ||
| decepticon attach --resume=THREAD_ID my-engagement`, | ||
| Args: cobra.ExactArgs(1), |
There was a problem hiding this comment.
Allow no-argument attach to list engagements
When an operator runs decepticon attach without a name, Cobra rejects the invocation before RunE, so the advertised no-argument listing behavior and the empty-slug branch of resolveEngagementOrList are unreachable; the user only receives an argument-count error. Accept zero or one argument and route the zero-argument case to the engagement listing.
Useful? React with 👍 / 👎.
attach <name> shared the desktop-service branch of runStartMode, so it started the stack, printed the desktop-ready line and exited without ever opening the CLI. runStartMode now takes attachInteractive: the desktop service still ends after readiness, attach drops the operator into RunInteractive on the existing engagement.
Addresses #1041
What
The first slice of the background engagement session lifecycle:
decepticon start --background: the full startup pipeline (verify Docker, select engagement, start services, wait for readiness) runs without attaching the interactive CLI. Prints the engagement name + attach hint, exits 0 with services kept running.decepticon attach <name>: re-opens the interactive CLI against an existing engagement workspace — same startup pipeline asstartminus the picker. Supports--resume/--continuesession selection. With no argument it lists available engagements.decepticon engagements: lists engagement workspaces with Red-approval state.EngagementEntryexported so the cmd package can render the list.This adapts the Claude Code
--bg→attach/logs/agentspattern to Decepticon's engagement semantics (an engagement resume, not a generic agent job).Compatibility
Launcher-only changes (Go/cobra). No runtime, container, or CLI/TUI changes. Cross-platform (macOS/Linux/WSL2/Windows) — no OS-specific code paths.
Verification
help_ux_test.goenforces Long+Example on every visible command —engagementsis now compliantFollow-up slices (per #1041)
decepticon logs <name>(transcript cursor + service logs)decepticon stopwhole-stack)