Skip to content

marcode: port upstream WS-reconnect + smoke node fix (PR #72)#72

Merged
tyulyukov merged 4 commits into
mainfrom
marcode/sync-upstream-2026-04-28
Apr 29, 2026
Merged

marcode: port upstream WS-reconnect + smoke node fix (PR #72)#72
tyulyukov merged 4 commits into
mainfrom
marcode/sync-upstream-2026-04-28

Conversation

@tyulyukov
Copy link
Copy Markdown
Owner

Summary

PR #72 brings MarCode current with upstream/main (pingdotgg/t3code) and bundles in-flight provider/adapter polish that was sitting in the worktree.

Upstream commits ported

  • pingdotgg/t3code#2364 fix(release): use configured node for smoke manifest merge — cherry-picked as 2f1e3cc3c. One-line change in scripts/release-smoke.ts so the smoke test invokes the same Node binary running the script (instead of whatever node resolves to on PATH inside the heredoc).
  • pingdotgg/t3code#2372 Ignore stale WebSocket lifecycle events after reconnect — cherry-picked as b408a6857. Adds a per-session id mechanism in apps/web/src/rpc/wsTransport.ts + protocol.ts so the OLD socket's eventually-fired `close`/`error` events are ignored after `reconnect()` swaps in a fresh `TransportSession`. Prevents phantom `closeCode`/`closeReason` flips and tracked-RPC clobbering. +85 lines purely additive — existing reconnect tests still pass unchanged.

Both cherry-picks landed cleanly. No conflicts. MarCode rebrand strings (`@marcode/contracts`, `"Unable to connect to the MarCode server WebSocket."`) are preserved.

Bundled provider/adapter polish (`ef574febf`)

Out-of-cycle but co-shipped per established "include WIP in same PR" practice:

  • CodexAdapter: backfill subagent-event tests for `7f04a4a11` (`task.progress` with `lastToolName`, `task.progress` with `summary`, child-thread delta-event suppression so subagent traffic doesn't pollute the parent transcript).
  • CursorAdapter: prefer `allow_once` over `allow_always` for auto-approval. `allow_always` writes `Shell()` into `~/.cursor/cli-config.json`; that allowlist makes Cursor skip `request_permission` entirely AND ship empty `rawInput:{}` on `tool_call` — which leaves `CommandExecutionCard` with no command text. Confirmed Cursor server-side bug (Mohit, Cursor team, forum thread).
  • effect-acp protocol.ts: `sendNotification` now encodes the JSON-RPC frame and logs both decoded + raw stages via `logProtocol` before enqueueing outgoing — matching the request/response paths.

Note for reviewers

Upstream's new `isActive` lives at the socket session layer (`WsProtocolLifecycleHandlers.isActive?`, gated on the session-id check inside `createSession`). It is distinct from the existing per-stream `isActive` parameter on `runStreamOnSession` in `wsTransport.ts:233` — they don't collide, but the same name in two places could confuse future readers.

Test plan

  • `bun run fmt` — clean across 980 files
  • `bun run lint` — 68 warnings / 0 errors (all pre-existing)
  • `bun run typecheck` — 10/10 packages successful
  • `apps/web` vitest — 97 files / 1104 tests, all passing; new `"ignores stale socket lifecycle events after a reconnect starts a new session"` test passes (29ms)
  • `apps/server` vitest — 102/103 files, 999 tests passing; new `task.progress with lastToolName` / `task.progress with summary` / `suppresses child-thread delta` tests all pass
  • CI green on `tyulyukov/marcode`

juliusmarminge and others added 4 commits April 28, 2026 16:05
…#2364)

Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 5cf83ff)
… logging

- CodexAdapter: backfill tests for child-thread subagent events — task.progress
  with lastToolName, task.progress with summary, and delta-event suppression so
  subagent traffic does not pollute the parent transcript.
- CursorAdapter: prefer allow_once over allow_always so Full-Access auto-approval
  does not write Shell(<base>) into ~/.cursor/cli-config.json — that allowlist
  causes Cursor to skip request_permission entirely and ship empty rawInput on
  tool_call, leaving the CommandExecutionCard with no command text.
- effect-acp protocol.ts: sendNotification now encodes the JSON-RPC frame and
  logs both decoded and raw stages via logProtocol before enqueueing outgoing,
  matching the request/response paths.
@tyulyukov tyulyukov merged commit 4782fbb into main Apr 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants