Skip to content

Add side-by-side chat sessions (Amicode: New Chat) - #238

Merged
aarontrowbridge merged 4 commits into
mainfrom
feat/side-by-side-chats
Aug 1, 2026
Merged

aarontrowbridge merged 4 commits into
mainfrom
feat/side-by-side-chats

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

What

New command Amicode: New Chat (Side by Side) (amicode.newChat): opens an additional chat editor tab at ViewColumn.Beside, pinned to the app's /new-session draft route. Each tab owns its own conversation; all tabs share the one opencode server. Tabs split across editor groups = true side-by-side sessions in one window.

How

  • chat_panel.ts: singleton → multi-instance registry. openOrReveal keeps primary semantics (auto-open, Open Chat untouched); new openNew always spawns a tab. Tab titles: Amicode Chat, Amicode Chat N (lowest free, reused on dispose; existing tabs never retitled).
  • extension.ts: command registration beside openChat with the same ready-server snapshot + credential gates.
  • package.json: command contribution ($(add) icon) + activation event.
  • No fork change/new-session exists in the pinned binary (v1.17.3-amicode.12).

Tests

5 new cases in test/chat_panel_sessions.test.ts: panel coexistence, openOrReveal reveal-isolation, title numbering/reuse, Beside column, auth-token carriage on the draft URL. vscode mock gains ViewColumn.Beside.

Gates

typecheck clean · fast suite 819/819 · esbuild bundle builds · boot smoke PASS.

Follow-ups (not in this PR)

  • Webview panel serializer so extra tabs survive window reload (sessions persist server-side regardless).
  • Fork-side postMessage bridge to mirror the session title into the tab label.
  • Test-isolation nits surfaced while running gates from inside a live Amicode shell: buildServerSpawnEnv reads process.env.AMICO_PYTHON; opencode_probe.mjs inherits OPENCODE_SERVER_PASSWORD (boot smoke 401s). Both unrelated to this change.

ChatPanel goes from singleton to multi-instance registry: openOrReveal keeps
primary semantics (auto-open, Open Chat), and a new openNew spawns an
additional editor tab at ViewColumn.Beside pinned to the app's /new-session
draft route — each tab owns its conversation over the one opencode server.
Tabs title Amicode Chat / Amicode Chat N (lowest free, reused on close).

No fork change needed: /new-session exists in the pinned binary
(v1.17.3-amicode.12). 5 new tests cover coexistence, reveal isolation,
title numbering, Beside column, and auth-token carriage.
- buildChildEnv: denylist OPENCODE / OPENCODE_PID / OPENCODE_SERVER_PASSWORD —
  they ride the OPENCODE_ prefix allowance into the child, whose headless run
  then resolves the PARENT's session ("Session not found") and dies before the
  critic starts. Config vars (OPENCODE_CONFIG_CONTENT/DIR) stay.
- CRITIC_TIMEOUT_MS 120s -> 240s: a frontier review of a full spec measures
  ~3 min on a free-tier model (178s, 2026-07-31); the 120s ceiling read slow
  legitimate answers as failures and silently degraded every review to
  approved-mechanical.
- Planner gets its own ceiling (PLANNER_TIMEOUT_MS = 480s): a full gated plan
  JSON is a bigger output than a critic pass and measured beyond 240s.
@aarontrowbridge
aarontrowbridge merged commit 68009de into main Aug 1, 2026
6 checks passed
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