Skip to content

feat(forge-session): add opencode-forge-session - #86

Merged
pedropombeiro merged 2 commits into
mainfrom
feat/forge-session
Oct 10, 2026
Merged

pedropombeiro merged 2 commits into
mainfrom
feat/forge-session

Conversation

@pedropombeiro

Copy link
Copy Markdown
Owner

What does this PR do and why?

Adds opencode-forge-session, which replaces opencode-forge-session-title. Besides the title prefixes, it shows the PR/MR status in the CLI footer and tells the agent about GitLab Duo and human review feedback. It keeps the old plugin and RPC IDs, so stored targets and target RPC callers carry over.

  • JSX CLI entry points: .mise/bundle.ts compiles src/tui.tsx with OpenTUI's Solid transform and keeps solid-js and @opentui/* external. Existing packages build to the same output.
  • First release: the feature commit carries Release-As: 1.0.0, because 0.x versions belong to the OpenCode 1 line. Keep the footer if you squash.
  • Tooling fixes: the dev task is now executable, so mise finds it, and a markdownlint config sets the repository's 100-column width.

References

How to set up and validate locally

OpenCode loads a local plugin directory by its root index file, so point it at dist/ rather than the package directory.

  1. Build the package:

    mise run build forge-session
  2. In opencode.json, replace opencode-forge-session-title with the absolute path to packages/forge-session/dist.

  3. Open a TUI in a checkout whose branch has an open PR/MR. The prompt footer shows its status, /forge-status opens the status dialog, and /forge-open opens the PR/MR.

Tested at 74e5792 with OpenCode 2.0.26: the server bundle loaded and answered the watch, refresh, release, and target RPCs, and the TUI rendered the footer and ran both commands.

The build, dev, and install-local tasks compiled only src/index.ts and
src/tui.ts, so a CLI entry point that renders JSX couldn't ship.

Add .mise/bundle.ts, which the three tasks share. It also compiles
src/tui.tsx through @opentui/solid's Bun plugin and keeps solid-js and
@opentui/* external, because OpenCode provides them at runtime. Existing
packages build to the same output as before.

Also:

- Raise @opencode/plugin to 2.0.26, add the OpenTUI and Solid dev
  dependencies for type checks, and pin Prettier to the locked 3.8.1.
- Make the dev task executable. mise skipped it, so `mise run dev`
  failed with "no task dev found".
- Add a markdownlint config with the repository's 100-column width, and
  wrap the AGENTS.md lines that exceeded it.
- Disable shellcheck's SC2154 for usage_package, which mise sets from
  the #USAGE lines.
Add a plugin that tracks each session's GitHub and GitLab issues and
PRs/MRs. It replaces opencode-forge-session-title and keeps its plugin
and RPC IDs, so stored targets and RPC callers carry over.

- The server keeps the title prefix, accepts up to 50 targets through
  set_session_target, and relates them to a shared issue_url.
- A CLI entry point shows the PR/MR status in the prompt footer, with
  /forge-status and /forge-open commands.
- The server polls the PRs/MRs of the sessions that CLIs show, and
  tells the agent when a GitLab Duo review finishes with feedback or
  people leave new review comments.

reviewStatus: false keeps only the title behavior.

Release-As: 1.0.0
@pedropombeiro
pedropombeiro merged commit e997694 into main Oct 10, 2026
2 checks passed
@pedropombeiro
pedropombeiro deleted the feat/forge-session branch October 10, 2026 12:29
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