Skip to content

feat(opencode): add session loop command (updated)#37504

Open
mgajda wants to merge 2 commits into
anomalyco:devfrom
mgajda:feat/loop-command-updated
Open

feat(opencode): add session loop command (updated)#37504
mgajda wants to merge 2 commits into
anomalyco:devfrom
mgajda:feat/loop-command-updated

Conversation

@mgajda

@mgajda mgajda commented Jul 17, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #23578

Type of change

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

What does this PR do?

This adds a built-in /loop command and /proactive alias. The original PR #23575 went stale and had merge conflicts with dev. This is an updated version rebased on current dev, with types adapted to the current API (ProviderV2.ID, SessionV1.User, EventV2Bridge, etc.) and the loop execution rewritten to use Effect.forkIn(scope) instead of setTimeout + Effect.runPromiseExit.

The command runs an immediate loop step, then continues either on a timer (/loop 5m ...) or in self-paced mode when the assistant ends with a continue marker. Also supports /loop stop, uses .claude/loop.md when no prompt is provided, and removes loop control markers from assistant text before it is shown in the session.

How did you verify your code works?

  • tsgo --noEmit passes
  • Two new unit tests for loop command parsing and control marker extraction
  • Two new integration tests for loop lifecycle adapted to the current it.instance pattern
  • All existing prompt tests pass

Screenshots / recordings

N/A.

Checklist

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

@github-actions

Copy link
Copy Markdown
Contributor

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

Found Related PR

PR #23575: feat(opencode): add session loop command
#23575

This is the original PR that the current PR #37504 is based on. The current PR is an updated rebase of #23575 with resolved merge conflicts and modernized types (ProviderV2.ID, SessionV1.User, EventV2Bridge, etc.). The PR description explicitly states: "The original PR #23575 went stale and had merge conflicts with dev. This is an updated version rebased on current dev..."

Note: PR #23575 should likely be closed in favor of this updated version (PR #37504) to avoid confusion and conflicting changes.

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.

[FEATURE]: Add /loop command for automated iterative task execution

1 participant