Skip to content

refactor(opencode): split Agent Swarm modules - #327

Merged
nicko-ai merged 1 commit into
devfrom
codex/agent-builder-large-file-cleanup
Jul 10, 2026
Merged

refactor(opencode): split Agent Swarm modules#327
nicko-ai merged 1 commit into
devfrom
codex/agent-builder-large-file-cleanup

Conversation

@nicko-ai

Copy link
Copy Markdown
Collaborator

Issue for this PR

No linked issue — this is a behavior-preserving refactor, which does not require one.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Splits two oversized Agent Swarm files into focused modules, moving code without changing behavior:

  • Extracts launcher command execution (runCommand, command logging, stderr line filtering, cancellation, resolveLauncherCommand, summarizePythonTraceback) from packages/opencode/src/agency-swarm/npx.ts into a new packages/opencode/src/agency-swarm/command.ts. npx.ts imports these and re-exports resolveLauncherCommand, so its existing import surface is unchanged.
  • Moves the 26 Agent Builder mode E2E tests from e2e/agent-swarm-tui/terminal-tui.test.ts into a new e2e/agent-swarm-tui/agent-modes.test.ts, with helpers both suites use in e2e/agent-swarm-tui/terminal-tui.helpers.ts.

This works because the logic is moved verbatim and all entry points resolve to the same implementations; the moved responsibilities are now isolated in their own modules.

How did you verify your code works?

  • packages/opencode typecheck passed.
  • Prettier check passed.
  • All 101 tests in packages/opencode/test/agency-swarm/npx.test.ts passed.
  • All 26 tests in e2e/agent-swarm-tui/agent-modes.test.ts passed in the real local terminal.

Screenshots / recordings

Not applicable — behavior and UI are unchanged.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

- extract launcher command execution from the Agent Swarm entrypoint

- isolate Agent Builder mode E2E coverage and shared helpers
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@nicko-ai
nicko-ai merged commit 8440060 into dev Jul 10, 2026
18 of 19 checks passed
@nicko-ai
nicko-ai deleted the codex/agent-builder-large-file-cleanup branch July 10, 2026 12:37
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