refactor: port typing-lag CI test to the v2 socket client#71
Merged
Conversation
This was the last CI-gated consumer of the v1 line-protocol client (tests/cmux.py). Points the import at tests_v2/cmux.py instead and ports the RawSocketClient used for the tight simulate_shortcut latency loop from v1 plaintext framing to v2's one-JSON-object-per-line protocol. The warm-up + measured-loop shape is unchanged (5 warm-up calls, then N timed round trips via perf_counter, same optional inter-call delay), so latency thresholds stay comparable to prior CI runs. list_workspaces()/list_surfaces() row shapes matched exactly between v1 and v2 clients, so the test's tuple destructuring needed no changes. seed_history() needed a small local send_line() helper since the v2 client mirrors most of v1's API but doesn't ship that one convenience method — added to the test file rather than tests_v2/cmux.py to keep the diff scoped to this one file. Part of the v1-protocol-deletion sequence: after this, no CI-gated code depends on the v1 client.
arzafran
added a commit
that referenced
this pull request
Jul 8, 2026
The v1 socket-protocol python test suite in tests/ (driven by tests/cmux.py) is superseded by tests_v2/, which now has full protocol parity. Deletes 85 files from tests/ plus scripts/run-tests-v1.sh (the manual VM runner for the retired suite). Two tests/ files stay because they're CI-wired in .github/workflows/ci.yml and don't depend on the v1 protocol: - test_cli_version_memory_guard.py (no socket protocol, standalone) - test_workspace_churn_up_arrow_lag.py (ported to the v2 client in #71) Also preserved: the CI/release-infrastructure guard scripts in tests/ (they guard workflow/build/release config, not app socket behavior, so they're unrelated to the v1 protocol) and tests/fixtures/ssh-remote, which tests_v2/ depends on. Fixes the one stale living reference to the deleted layout in docs/v2-api-migration.md. Dated historical changelog/checklist entries in TODO.md, PROJECTS.md, and docs/agent-browser-port-spec.md that record past VM validation runs are left untouched as historical record. Part of the v1-protocol-deletion sequence (step 5).
2 tasks
arzafran
added a commit
that referenced
this pull request
Jul 8, 2026
The v1 socket-protocol python test suite in tests/ (driven by tests/cmux.py) is superseded by tests_v2/, which now has full protocol parity. Deletes 85 files from tests/ plus scripts/run-tests-v1.sh (the manual VM runner for the retired suite). Two tests/ files stay because they're CI-wired in .github/workflows/ci.yml and don't depend on the v1 protocol: - test_cli_version_memory_guard.py (no socket protocol, standalone) - test_workspace_churn_up_arrow_lag.py (ported to the v2 client in #71) Also preserved: the CI/release-infrastructure guard scripts in tests/ (they guard workflow/build/release config, not app socket behavior, so they're unrelated to the v1 protocol) and tests/fixtures/ssh-remote, which tests_v2/ depends on. Fixes the one stale living reference to the deleted layout in docs/v2-api-migration.md. Dated historical changelog/checklist entries in TODO.md, PROJECTS.md, and docs/agent-browser-port-spec.md that record past VM validation runs are left untouched as historical record. Part of the v1-protocol-deletion sequence (step 5).
arzafran
added a commit
that referenced
this pull request
Jul 8, 2026
v2 JSON-RPC is now the only socket protocol. All consumers were migrated first (CLI in #74, shell integration in #72, tests in #71/#73; the remote daemon was already v2-only), so this deletes the v1 line dispatch itself and everything that only existed to serve it. - TerminalController.processCommand now dispatches JSON unconditionally; a non-JSON line gets a terse v1_removed error instead of being routed to the old space-delimited command switch. - Deletes the v1 switch (~90 cases) and every handler function that becomes unreferenced, plus their v1-only parsing helpers (parseOptions/parseOptionsNoStop, resolveTabForReport, withReportTargetSurface, upsertSidebarMetadata/clearSidebarMetadata/ listSidebarMetadata, schedulePanelMetadataMutation, parseReadScreenArgs). Debug handlers that v2's debug.* methods reuse as their implementation core (setShortcut, simulateShortcut, activateApp, isTerminalFocused, readTerminalText, renderStats, layoutDebug, bonsplit/empty-panel/flash counters, focusFromNotification, panelSnapshot(Reset), captureScreenshot) are kept, since they're still live v2 entry points, not v1 relics. Self.socketFastPathState and tailTerminalLines/ readTerminalTextBase64(terminalPanel:) stay too - v2 surface-telemetry and screen-read methods depend on them directly. - auth was already a connection-level preamble (authResponseIfNeeded, handled before any protocol dispatch) supporting both a raw auth-plus-password line and v2 auth.login; only the CLI's raw-line call needed migrating, which this does (auth.login now). - Removes the now-unreachable isV2:false focus-intent allowlist (focusIntentV1Commands) and updates the one unit test that exercised it directly to cover the v2 equivalent instead. - Docs: v2-api-migration.md collapses to a short removal note plus the v1->v2 name mapping (kept for reference); socket-focus-steal-audit.todo.md and agent-browser-port-spec.md get historical annotations; CLAUDE.md's socket-threading-policy examples are reworded to v2 method names. TerminalController.swift: 12834 -> 9615 lines (-3219). Net repo diff: +156/-3410 across 7 files. Breaking change: any external script or tool that still speaks the old space-delimited socket protocol directly (rather than through the CLI) will now get a v1_removed JSON error instead of a response. Use the CLI or the v2 JSON-RPC protocol described in docs/v2-api-migration.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
The typing-lag regression test that runs in CI (
tests-build-and-lagjob) was the last CI-gated python test still talking to the app through the old v1 socket protocol. This points it at the v2 JSON client instead, so v1's line-protocol client can eventually be deleted without breaking CI.Summary
tests/test_workspace_churn_up_arrow_lag.pynow importscmux/cmuxErrorfromtests_v2/instead oftests/cmux.py.list_workspaces()/list_surfaces()row shapes are identical between the v1 and v2 clients, so the test's tuple destructuring (for _index, wid, _title, _selected in ...) needed no changes.send_line()convenience method (it mirrors most, but not all, of v1's API), so a small localsend_line()helper was added to the test file — kept out oftests_v2/cmux.pyto keep this diff scoped to one file.RawSocketClient, used only for the tightsimulate_shortcutlatency-measurement loop, was ported from v1's raw plaintext framing to v2's one-JSON-object-per-line protocol ({"id", "method", "params"}request /{"id", "ok", "result"}response), callingdebug.shortcut.simulate. The warm-up-then-measure loop shape (5 warm-up calls, then N timed round trips viatime.perf_counter(), same optional inter-call delay) is unchanged, so latency numbers stay comparable to prior runs.keep_only_first_workspace()'s retry-on-"not found" loop is preserved; v2's error text (not_found: Workspace not found) still contains "not found" case-insensitively, same as v1's "ERROR: Tab not found", so the existing match logic covers both..github/workflows/ci.ymlneeded no changes — it invokes the same file path with the samePROGRAMA_SOCKET_PATHenv var, which both clients honor.Test Plan
python3 -c "import ast; ast.parse(open('tests/test_workspace_churn_up_arrow_lag.py').read())"— syntax OKcmuxresolves totests_v2/cmux.py(nottests/cmux.py)