Skip to content

Theorem chat register: Studio panel + /chat, retire OpenWork host - #193

Merged
Travis-Gilbert merged 1 commit into
mainfrom
feat/theorem-chat-register
Aug 5, 2026
Merged

Theorem chat register: Studio panel + /chat, retire OpenWork host#193
Travis-Gilbert merged 1 commit into
mainfrom
feat/theorem-chat-register

Conversation

@Travis-Gilbert

@Travis-Gilbert Travis-Gilbert commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • New @commonplace/theorem-chat-register (register_impl=theorem.chat) with session controller, HTTP stream transport, React register, Studio webview HTML.
  • Studio: Theorem: Open Chat webview over hosted ACP.
  • Console: /chat renders Theorem register; OpenWork reverse-proxy is off unless CONSOLE_OPENWORK_CHAT_PROXY=1.
  • Canonical + register-impl + OW SPEC supersession; EXECUTE-REPORT for plan-theorem-chat-register-20260805a.

Test plan

  • pnpm --filter @commonplace/theorem-chat-register test
  • node scripts/check-register-manifest.mjs
  • console chat page vitests
  • pnpm --filter theorem-vscode check && build && test
  • After merge: console deploy; node scripts/doctor.mjs /chat green (loginish or theorem.chat stamp)
  • Signed-in /IDE → Theorem: Open Chat

Plan: docs/plans/theorem-chat-register/PLAN.md

Summary by CodeRabbit

  • New Features

    • Added Theorem Chat as the primary chat experience in Console and Studio.
    • Added streaming conversations, session state, message history, error handling, and disabled composer states.
    • Added a Theorem Chat panel and theorem.openChat command to the VS Code extension.
  • Bug Fixes

    • Clarified workspace service ports and chat host behavior.
    • Disabled legacy chat proxying by default, with an emergency rollback option.
  • Documentation

    • Documented the OpenWork chat retirement, migration, validation status, and rollback process.

Add @commonplace/theorem-chat-register (theorem.chat), mount it in the
theorem-vscode chat panel and at /chat, and retire OpenWork as the product
chat host (opt-in CONSOLE_OPENWORK_CHAT_PROXY rollback only).
Copilot AI lite review requested due to automatic review settings August 5, 2026 23:23
@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, add credits to your account and enable them for code reviews in your settings.

@Travis-Gilbert
Travis-Gilbert merged commit 0fba892 into main Aug 5, 2026
7 of 12 checks passed
@ecc-tools

ecc-tools Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@Travis-Gilbert
Travis-Gilbert deleted the feat/theorem-chat-register branch August 5, 2026 23:23
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f422a8e0-6bc2-4cf2-b695-d8062aeb3c46

📥 Commits

Reviewing files that changed from the base of the PR and between 8857e86 and f696905.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (35)
  • .commonplace-canonical
  • .gitignore
  • .harness/checklists/theorem-chat-register--plan-local-20260805a.json
  • apps/console/package.json
  • apps/console/src/app/chat/[threadId]/page.test.tsx
  • apps/console/src/app/chat/[threadId]/page.tsx
  • apps/console/src/app/chat/page.test.tsx
  • apps/console/src/app/chat/page.tsx
  • apps/console/src/lib/register-impl.ts
  • apps/console/src/middleware.ts
  • apps/console/src/views/OpenworkChatRegister.tsx
  • apps/console/src/views/TheoremChatRegister.tsx
  • apps/console/src/views/registry.tsx
  • apps/theorem-vscode/package.json
  • apps/theorem-vscode/src/agent/chat-panel.ts
  • apps/theorem-vscode/src/extension.ts
  • apps/theorem-vscode/tsconfig.json
  • apps/theorem-vscode/vitest.config.ts
  • docs/plans/console/SPEC-COMMONPLACE-OPENWORK-FORK-1.0.md
  • docs/plans/ide-substrate-wire/FOLLOW-UP-CODE-SERVE-WEB.md
  • docs/plans/theorem-chat-register/EXECUTE-REPORT.md
  • docs/plans/theorem-chat-register/PLAN.md
  • docs/plans/theorem-chat-register/SPEC-THEOREM-CHAT-REGISTER-1.0.md
  • packages/theorem-chat-register/package.json
  • packages/theorem-chat-register/src/TheoremChatRegister.tsx
  • packages/theorem-chat-register/src/http-stream-transport.ts
  • packages/theorem-chat-register/src/index.ts
  • packages/theorem-chat-register/src/register-impl.ts
  • packages/theorem-chat-register/src/session.test.ts
  • packages/theorem-chat-register/src/session.ts
  • packages/theorem-chat-register/src/transport.ts
  • packages/theorem-chat-register/src/webview-html.ts
  • packages/theorem-chat-register/tsconfig.json
  • packages/theorem-chat-register/vitest.config.ts
  • scripts/check-register-manifest.mjs

📝 Walkthrough

Walkthrough

The PR adds the @commonplace/theorem-chat-register package, implements session and streaming behavior, mounts theorem.chat in Console and VS Code, and disables OpenWork chat proxying unless explicitly enabled for rollback.

Changes

Theorem chat register

Layer / File(s) Summary
Register package and session flow
packages/theorem-chat-register/*, docs/plans/theorem-chat-register/SPEC-THEOREM-CHAT-REGISTER-1.0.md
Defines the theorem.chat contract, session controller, HTTP streaming transport, React register, webview renderer, exports, tests, and package configuration.
Console routes and registry wiring
apps/console/package.json, apps/console/src/app/chat/*, apps/console/src/views/*, apps/console/src/lib/register-impl.ts, apps/console/src/middleware.ts
Routes and registry descriptors render TheoremChatRegisterView. The /chat proxy requires CONSOLE_OPENWORK_CHAT_PROXY=1 and a workspace URL.
VS Code chat panel integration
apps/theorem-vscode/package.json, apps/theorem-vscode/src/*, apps/theorem-vscode/tsconfig.json, apps/theorem-vscode/vitest.config.ts
Adds theorem.openChat and an ACP-backed TheoremChatPanel webview.
OpenWork retirement and validation records
.commonplace-canonical, .harness/checklists/*, docs/plans/*, scripts/check-register-manifest.mjs, .gitignore
Records OpenWork supersession, rollback details, validation evidence, checklist status, manifest allowances, deployment notes, and the local pnpm store ignore rule.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: copilot

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/theorem-chat-register

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

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the console’s product /chat surface and the Studio chat panel surface with a single shared “Theorem chat register” implementation (register_impl=theorem.chat), retiring the OpenWork reverse-proxy path by default and documenting the supersession in the plan/spec artifacts.

Changes:

  • Add new @commonplace/theorem-chat-register package (session controller, HTTP stream transport, React register UI, and Studio webview HTML shell).
  • Mount the register in Studio via Theorem: Open Chat (apps/theorem-vscode) and in Console via /chat pages + updated view registry, with OpenWork proxy disabled unless CONSOLE_OPENWORK_CHAT_PROXY=1.
  • Update plan/spec/execute-report + canonical manifest wiring (.commonplace-canonical, manifest gate, supersession notes).

Reviewed changes

Copilot reviewed 34 out of 36 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/check-register-manifest.mjs Allows prototype.stage as an unmanifested companion descriptor.
pnpm-lock.yaml Adds workspace links for the new theorem chat register package.
packages/theorem-chat-register/vitest.config.ts Vitest configuration for the new package.
packages/theorem-chat-register/tsconfig.json TS config for the new package.
packages/theorem-chat-register/src/webview-html.ts Generates CSP-stamped Studio webview HTML shell for chat.
packages/theorem-chat-register/src/transport.ts Defines injectable ChatTransport interface.
packages/theorem-chat-register/src/TheoremChatRegister.tsx React register UI for /chat and Studio.
packages/theorem-chat-register/src/session.ts Session controller with snapshot + prompt orchestration.
packages/theorem-chat-register/src/session.test.ts Package-level tests for controller behavior + stamp.
packages/theorem-chat-register/src/register-impl.ts Defines canonical REGISTER_IMPL = 'theorem.chat'.
packages/theorem-chat-register/src/index.ts Barrel exports for the package surface.
packages/theorem-chat-register/src/http-stream-transport.ts Fetch/SSE transport for console /api/chat/stream.
packages/theorem-chat-register/package.json Package metadata, exports, scripts, and deps.
docs/plans/theorem-chat-register/SPEC-THEOREM-CHAT-REGISTER-1.0.md Updates the normative spec with finalized contract + mounts.
docs/plans/theorem-chat-register/PLAN.md Marks CR tasks done/verifying and updates plan board status.
docs/plans/theorem-chat-register/EXECUTE-REPORT.md Adds execution report and remaining rollout steps.
docs/plans/ide-substrate-wire/FOLLOW-UP-CODE-SERVE-WEB.md Updates status to reflect Copilot retirement and chat register plan link.
docs/plans/console/SPEC-COMMONPLACE-OPENWORK-FORK-1.0.md Adds supersession note: OpenWork no longer product /chat host.
apps/theorem-vscode/vitest.config.ts Adds path alias for theorem chat register source during tests.
apps/theorem-vscode/tsconfig.json Adds TS path mapping for theorem chat register imports.
apps/theorem-vscode/src/extension.ts Registers theorem.openChat command and wires chat panel.
apps/theorem-vscode/src/agent/chat-panel.ts Implements Studio webview panel powered by shared controller + HTML.
apps/theorem-vscode/package.json Adds dependency + command contribution for “Theorem: Open Chat”.
apps/console/src/views/TheoremChatRegister.tsx Console wrapper view that provides HTTP stream transport.
apps/console/src/views/registry.tsx Switches chat descriptors/renderers to Theorem chat register.
apps/console/src/views/OpenworkChatRegister.tsx Deprecates OpenWork register view to forward to Theorem register.
apps/console/src/middleware.ts Gates OpenWork reverse-proxy behind CONSOLE_OPENWORK_CHAT_PROXY=1.
apps/console/src/lib/register-impl.ts Updates chat.surface register impl mapping to theorem.chat.
apps/console/src/app/chat/page.tsx /chat now renders Theorem register instead of OpenWork redirect/proxy flow.
apps/console/src/app/chat/page.test.tsx Updates tests to assert Theorem register render.
apps/console/src/app/chat/[threadId]/page.tsx Thread pages render Theorem register (context only for now).
apps/console/src/app/chat/[threadId]/page.test.tsx Updates thread page tests for theorem.chat stamp.
apps/console/package.json Adds dependency on @commonplace/theorem-chat-register.
.harness/checklists/theorem-chat-register--plan-local-20260805a.json Updates checklist statuses/evidence notes for CR-003..007.
.gitignore Ignores local .pnpm-store/.
.commonplace-canonical Updates canonical register record: /chat now theorem.chat, supersedes openwork.chat.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (1)

apps/theorem-vscode/src/agent/chat-panel.ts:36

  • Nonce generation should be unpredictable; Date.now() is guessable. After importing randomUUID, generate the nonce from it.
    const nonce = String(Date.now());

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

### Public API (CR-004)

- `REGISTER_IMPL = 'theorem.chat'`
- `ChatTransport`: `{ openSession(), prompt(text), subscribe(listener), dispose() }`
Comment on lines +39 to +44
const snapshot = (): ChatSessionSnapshot => ({
sessionId: sessionId ?? '',
messages,
running,
error,
});
Comment on lines +52 to +57
async open() {
error = null;
sessionId = await transport.openSession();
emit();
return sessionId;
},
Comment on lines +43 to +54
buffer += decoder.decode(value, { stream: true });
const parts = buffer.split('\n\n');
buffer = parts.pop() ?? '';
for (const part of parts) {
const dataLine = part
.split('\n')
.find((line) => line.startsWith('data:'));
if (!dataLine) continue;
const raw = dataLine.slice('data:'.length).trim();
const chunk = textOf(raw);
if (chunk) onDelta(chunk);
}
Comment on lines +4 to +7
import * as vscode from 'vscode';
import { createChatSessionController } from '@commonplace/theorem-chat-register/session';
import { renderTheoremChatWebviewHtml } from '@commonplace/theorem-chat-register/webview-html';
import type { ChatTransport } from '@commonplace/theorem-chat-register/transport';
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.

2 participants