Skip to content

mcpx: session inventory operation (GET /v1/sessions) — slice 1 of #1931 - #2594

Merged
dezren39 merged 6 commits into
mainfrom
queue/3226-1931-sessions-read
Nov 4, 2026
Merged

dezren39 merged 6 commits into
mainfrom
queue/3226-1931-sessions-read

Conversation

@dezren39

@dezren39 dezren39 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Slice 1 of #1931 (queue task 3226): the session inventory as a declared operation.

What changed

  • internal/api/ops.go: new sessions_read operation — GET /v1/sessions — declared in the ops table, so the route, the generated MCP proxy tool (mcpx_sessions_read), the generated CLI command (mcpx sessions read) and the OpenAPI entry all come from the one declaration. No hand-written route/tool/command.
  • internal/daemon/routes_sessions.go: the handler assembles the answer from Registry.Status() and flattens every pool's instances into one list, reusing pool.InstanceStatus unchanged (id, pid, holders, key, calls, uptimeSec, idleSec) — no parallel struct. An empty inventory renders as an empty list, never null or an error.
  • Regenerated surfaces: plugin/opencode/mcpx/ops.gen.ts and docs/parity.md (via the suites' -update runs).
  • No kill/detach/resume/install/intent-routing behaviour — those are later mcpx: administration by intent — finish the operation surface, then route a sentence to a declared operation #1931 slices, excluded by the task scope.

Tests (laptop)

  • New daemon tests: empty inventory is an empty (non-nil) list; a populated inventory flattens every pool with InstanceStatus fields unchanged; the handler on an empty registry returns 200 with [].
  • go test ./internal/api/ passes (including parity and the plugin-generation check); CLI parity tests pass (TestParityDocumentIsCurrent, command-reach, plugin-op-tag). Full go test ./... runs in CI.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner October 30, 2026 06:11
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ec31809a-b8cf-4fcd-af0c-d477a6db35b0
Commits

Reviewing files that changed from the base of the PR and between 7a85004 and e277c04.

Files selected for processing: 8
  • .opencode/plugin/mcpx-session.ts
  • .opencode/plugin/mcpx/ops.gen.ts
  • pkgs/mcpx/docs/parity.md
  • pkgs/mcpx/internal/api/ops.go
  • pkgs/mcpx/internal/daemon/routes_sessions.go
  • pkgs/mcpx/internal/daemon/routes_sessions_test.go
  • pkgs/mcpx/internal/daemon/server.go
  • pkgs/mcpx/plugin/opencode/mcpx/ops.gen.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 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-11-03T23:04:09.276343Z e277c04 New commits
ℹ️ 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.

The basic tier's plugin-sync check compares pkgs/mcpx/plugin/opencode/mcpx
with the repo's dogfood copy .opencode/plugin/mcpx. PR #2594 regenerated
the pkgs copy for the new sessions_read operation but left the dogfood
copy behind, so the check failed at diff -r. Copy the regenerated file
across; both diff -r and the mcpx-session.ts diff are clean.

No logic change: .opencode/plugin/mcpx/ops.gen.ts is generated output.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

dezren39 and others added 4 commits November 3, 2026 10:49
Resolves the four conflicts the branch picked up while it sat unmerged
(behind 3016 commits):

- internal/api/ops.go: taken from main, which has since added the
  Permission tier and authz_decisions; sessions_read re-inserted after
  status with PermissionRead.
- internal/daemon/server.go: taken from main's s.route() registration
  (which records the authorisation decision); routesSessions called
  after the status route.
- routes_sessions.go: module path was github.com/dezren39/mcpx, stale
  in this repo (module github.com/developing-today/code/pkgs/mcpx);
  registered through s.route so the decision is recorded.
- docs/parity.md: regenerated (87 ops, 72 commands).

Also syncs two dogfood plugin copies with their pkgs originals:
ops.gen.ts (sessionsRead; the packet's fix) and mcpx-session.ts, which
had already drifted on main (pkgs copy carries the transient-discovery
retry fix, .opencode copy still had missedAt = Date.now()).

No behaviour change beyond the intended slice-1 route.
@dezren39
dezren39 merged commit 373d23b into main Nov 4, 2026
3 checks passed
@dezren39
dezren39 deleted the queue/3226-1931-sessions-read branch November 4, 2026 01:51
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