Skip to content

test(e2e): CLI, config, MCP robustness, daemon state, and agent-sidecar coverage - #177

Merged
skzv merged 2 commits into
mainfrom
claude/e2e-cli-daemon
Aug 4, 2026
Merged

test(e2e): CLI, config, MCP robustness, daemon state, and agent-sidecar coverage#177
skzv merged 2 commits into
mainfrom
claude/e2e-cli-daemon

Conversation

@skzv

@skzv skzv commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Nine new hermetic e2e tests in internal/e2e/. No production changes.

Regression tests for bugs fixed this week (fail-before verified by reverting the fix and observing the exact failure):

New coverage:

  • TestMCPServer_SurvivesOversizedFrame — a 4MiB+ frame gets a -32700 error with a literal "id": null, and the next request still succeeds (the server didn't die).
  • TestMCPServer_ProtocolVersionNegotiation — supported version echoed; garbage falls back to the server's latest.
  • TestDaemonIPC_SessionStateObserved — a stub-agent session is observed through the daemon socket and cross-checked against ccmux list --json, polled with a timeout rather than sleeping.
  • TestSessionKill_NonexistentFailsCleanly — non-zero exit, clear stderr, no panic, and a bystander session survives.
  • TestProjectAgentSidecar_NewWritesAttachHonors.ccmux/agent is written on create and honored by a later flagless attach (extends the existing default/flag agent tests rather than duplicating them).

Verification

All 9 pass individually; full make test-e2e green (e2e 45s, ccmuxd 11s); go test ./... green; gofmt + vet clean.

One observation, not a bug: doctor's timeout branch (subcommands.go:472) omits the port number, so a timing-out custom-port host doesn't show which port was probed. The refused/OK branches do name it.

🤖 Generated with Claude Code

skzv and others added 2 commits August 4, 2026 11:33
…gent sidecar

Regression tests for this week's fixes, verified to fail against the
pre-fix behavior:

- TestVersionFlag_Works — `ccmux --version` exits 0 and prints a
  version line (#169: rootCmd.Version assigned in init() before
  Execute set it, so the flag was never registered). Includes an
  unknown-flag control so the pass proves registration, not blanket
  flag acceptance.
- TestHostAdd_RejectsDuplicateName — duplicate `host add` fails,
  names the conflict, and leaves exactly one entry with the original
  address (#172).
- TestConfigFile_Mode0600AndRewriteKeepsBothChanges — config.toml is
  written 0600 and survives back-to-back CLI rewrites with both
  changes plus pre-existing content intact (#169: 0644 + non-atomic).
- TestDoctor_HonorsConfiguredSSHPort — doctor's per-host probe names
  the configured ssh_port, not hardcoded 22 (#169). Offline-safe:
  closed loopback port, instant ECONNREFUSED.

New coverage gaps:

- TestMCPServer_SurvivesOversizedFrame — a >4 MiB stdin line gets a
  JSON-RPC -32700 with literal-null id and the next request is still
  served (#172: bufio.Scanner ErrTooLong used to kill the transport).
- TestMCPServer_ProtocolVersionNegotiation — supported revisions are
  echoed back; unsupported/garbage get the server's latest (#172).
- TestDaemonIPC_SessionStateObserved — a `ccmux shell` session running
  the stub agent settles into a plausible state over the daemon socket
  and via `ccmux list --json`, polled with timeouts.
- TestSessionKill_NonexistentFailsCleanly — non-zero exit, clear
  stderr, no panic, other sessions unharmed.
- TestProjectAgentSidecar_NewWritesAttachHonors — `ccmux new --agent
  codex` writes .ccmux/agent and launches codex; after kill, a bare
  `ccmux attach` re-creates the session from the sidecar alone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@skzv
skzv merged commit 099dc88 into main Aug 4, 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