[PR #656] [CLOSED] feat: Add autonomous session-loop command #9676

Closed
opened 2026-02-16 18:13:58 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/656
Author: @kuwosaad
Created: 7/3/2025
Status: Closed

Base: devHead: feat/session-loop


📝 Commits (1)

  • d8dcedc feat: Add autonomous session-loop command

📊 Changes

4 files changed (+530 additions, -0 deletions)

View changed files

install_bun.sh (+320 -0)
packages/opencode/src/cli/cmd/session-loop.ts (+89 -0)
📝 packages/opencode/src/index.ts (+2 -0)
packages/opencode/test/session-loop.test.ts (+119 -0)

📄 Description

Implements a new CLI command opencode session-loop <modelA> <modelB> --message "mission brief" that enables two AI sessions to engage in an autonomous, back-and-forth chat loop.

This command:

  • Creates two OpenCode sessions.
  • Relays messages between them, starting with the initial mission brief to the first agent.
  • Allows both agents to use OpenCode tools (though tool usage in the loop is implicitly supported via Session.chat and not explicitly tested in this iteration).

A basic test suite has been added to verify command argument parsing and the initial message relay.

Limitation: Due to sandbox restrictions preventing the installation and use of bun, local verification via bun install, bun run typecheck, and bun test could not be performed. It is recommended these checks be run in a CI environment or locally by a maintainer with bun installed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/656 **Author:** [@kuwosaad](https://github.com/kuwosaad) **Created:** 7/3/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `feat/session-loop` --- ### 📝 Commits (1) - [`d8dcedc`](https://github.com/anomalyco/opencode/commit/d8dcedce2490b8efa87c6d8b6916d0b543e9dcd3) feat: Add autonomous session-loop command ### 📊 Changes **4 files changed** (+530 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `install_bun.sh` (+320 -0) ➕ `packages/opencode/src/cli/cmd/session-loop.ts` (+89 -0) 📝 `packages/opencode/src/index.ts` (+2 -0) ➕ `packages/opencode/test/session-loop.test.ts` (+119 -0) </details> ### 📄 Description Implements a new CLI command `opencode session-loop <modelA> <modelB> --message "mission brief"` that enables two AI sessions to engage in an autonomous, back-and-forth chat loop. This command: - Creates two OpenCode sessions. - Relays messages between them, starting with the initial mission brief to the first agent. - Allows both agents to use OpenCode tools (though tool usage in the loop is implicitly supported via Session.chat and not explicitly tested in this iteration). A basic test suite has been added to verify command argument parsing and the initial message relay. Limitation: Due to sandbox restrictions preventing the installation and use of `bun`, local verification via `bun install`, `bun run typecheck`, and `bun test` could not be performed. It is recommended these checks be run in a CI environment or locally by a maintainer with `bun` installed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:58 -05:00
yindo closed this issue 2026-02-16 18:13:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9676