Skip to content

feat(rpc): handle extension requests directly - #822

Merged
code-yeongyu merged 2 commits into
mainfrom
feat/extension-rpc-requests-20260812
Aug 11, 2026
Merged

feat(rpc): handle extension requests directly#822
code-yeongyu merged 2 commits into
mainfrom
feat/extension-rpc-requests-20260812

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Problem

Extension RPC was one-way: extensions could emit capability-gated state, but an RPC client could
not invoke extension-owned controls without turning them into slash-command prompts.

Fix

  • add generation-owned pi.rpc.handle(name, handler) registration
  • add the session-scoped extension_request JSONL command and structured response
  • expose RpcClient.requestExtension()
  • reject empty, unknown, duplicate, and stale-generation handlers
  • preserve existing multi-session routing and response tagging
  • document the public extension and wire contracts

Verification

  • npm --prefix packages/coding-agent test -- test/suite/rpc-extension-requests.test.ts test/suite/rpc-extension-events.test.ts test/rpc-multi-session.test.ts
  • npx tsc --noEmit --pretty false
  • npm run build
  • npm run check
  • mutation proof: forcing a beta request into the alpha binding fails the new isolation assertion

Model: gpt-5.6-sol-fast
Harness: omo-senpi


Summary by cubic

Enables direct client-to-extension RPC requests so clients can call extension-owned handlers without the model. Adds a session-scoped RPC command and client API with strict validation, multi-session tagging, and rejection of stale or in-flight results after reloads.

  • New Features

    • pi.rpc.handle(name, handler) to register one handler per name on the active extension generation; rejects empty, unknown, duplicate, and stale-generation cases.
    • New RPC command extension_request with structured success/error responses; data is opaque; responses include sessionId in multi-session mode.
    • RpcClient.requestExtension(name, data?) to call a handler and get its result.
    • Docs updated; tests cover handler routing, multi-session isolation, and generation liveness.
  • Bug Fixes

    • Reject stale in-flight handler results by re-checking generation liveness after handler completion; invalidate the previous ExtensionRunner after reload notifications.
    • pi.rpc.emit() now asserts generation liveness before publishing.

Written for commit 901171b. Summary will update on new commits.

Review in cubic

@code-yeongyu
code-yeongyu merged commit 02f5a04 into main Aug 11, 2026
14 checks passed
@code-yeongyu
code-yeongyu deleted the feat/extension-rpc-requests-20260812 branch August 11, 2026 17:07
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