Open
Conversation
chenhg5
approved these changes
Mar 28, 2026
Owner
chenhg5
left a comment
There was a problem hiding this comment.
LGTM. Good fix for CLI command validation.
Review notes:
- CI unit-test failing (but author notes this is an existing failure in
platform/wecom.TestWecomInboundFileMime, not related to this change) - Correct approach: explicit command map + validation for unknown commands
- Good test coverage for edge cases
- Fixes the issue where invalid commands like
cc-connect bind --helpwould fall through to bridge startup
The change properly rejects unknown top-level commands before they can trigger unwanted behavior. Approved for merge once CI passes (or the unrelated test failure is addressed separately).
f24529f to
3648aaf
Compare
3648aaf to
02cb26b
Compare
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.
Summary
Problem
Commands such as
cc-connect bind --helpwere treated as normal startup because only a small set of top-level subcommands were explicitly dispatched. That let an invalid top-level command continue into the full bridge startup path, potentially launching a second instance and rebinding~/.cc-connect/run/api.sock.Testing
nix shell nixpkgs#go -c go test ./cmd/cc-connectnix shell nixpkgs#go -c go test ./agent/codex -run TestSend_UsesStdinForMultilinePrompt -count=1 -vnix shell nixpkgs#go -c go test ./...(currently still fails outside this change inplatform/wecom.TestWecomInboundFileMime; one full-suite run also hit a transientagent/codexfailure that passed on isolated rerun)