Skip to content

feat(launcher): background engagement lifecycle — --background, attach, engagements - #1049

Merged
PurpleCHOIms merged 3 commits into
mainfrom
feat/background-engagements
Oct 22, 2026
Merged

PurpleCHOIms merged 3 commits into
mainfrom
feat/background-engagements

Conversation

@PurpleCHOIms

Copy link
Copy Markdown
Member

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 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 exported so the cmd package can render the list.

This adapts the Claude Code --bg → attach/logs/agents pattern 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

  • Go build + vet green; cmd + engagement tests pass
  • help_ux_test.go enforces Long+Example on every visible command — engagements is now compliant

Follow-up slices (per #1041)

  • decepticon logs <name> (transcript cursor + service logs)
  • Per-engagement cancel (independent of decepticon stop whole-stack)

…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).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T00:51:23.985230Z 1118072 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: 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".

Comment thread clients/launcher/cmd/attach.go Outdated
return err
}
ui.Info("Attaching to engagement " + slug + "…")
return runStartMode(cmd, nil, slug)

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 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 👍 / 👎.

Comment on lines +102 to +103
startCmd.Flags().BoolVar(&backgroundRun, "background", false,
"Start services and prepare the engagement without opening the interactive CLI; attach later with 'decepticon attach <name>'")

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 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),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

mschoi added 2 commits October 22, 2026 17:48
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.
@PurpleCHOIms
PurpleCHOIms merged commit 547de7a into main Oct 22, 2026
27 checks passed
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