Skip to content

fix(cli): exit non-zero when feedback submission is rejected - #1766

Merged
Dumbris merged 1 commit into
smart-mcp-proxy:mainfrom
rudycelekli:fix/feedback-exit-code-20261023-01
Oct 26, 2026
Merged

Dumbris merged 1 commit into
smart-mcp-proxy:mainfrom
rudycelekli:fix/feedback-exit-code-20261023-01

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

Bug

mcpproxy feedback exits 0 when the submission was not accepted. SubmitFeedback returns Success: false without an error in two cases: the backend answers 2xx with {"success": false, "error": "..."}, or it answers a non-JSON 3xx. runFeedback prints "Feedback submission failed: ..." (in text mode) and then returns nil. In -o json mode it prints the JSON and also returns nil. Scripts and CI wrappers therefore treat a rejected submission as sent.

Trigger

With the telemetry endpoint returning 200 {"success":false,"error":"rejected by backend"}:

$ mcpproxy feedback "the search results could be more relevant" --category bug
Feedback submission failed: rejected by backend
$ echo $?
0

Fix

After rendering the output, return feedback submission failed: <error> when resp.Success is false, so the exit code is non-zero in both text and JSON modes. The text branch no longer prints its own failure line, because cobra prints the returned error. The success path is unchanged.

Test

TestRunFeedback_RejectedSubmissionReturnsError points the telemetry endpoint at an httptest server that returns {"success":false}, and asserts that runFeedback returns an error.

Commands run

  • go vet ./cmd/mcpproxy: clean
  • go test -count=1 ./cmd/mcpproxy: ok (needs cgo; run with SDKROOT set to the macOS 26.5 SDK locally)
  • Without the fix, the new test fails with runFeedback returned nil for a submission the backend rejected.
  • gofmt -l on the edited files: no output

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Dumbris Dumbris left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: the PR test fails on main for the reason described and passes on this branch merged with main; race tests for the touched packages and CI lint (bare and server tags) are clean. Also built and tested together with the rest of this batch, independently reviewed, and cross-reviewed with a second model.

@Dumbris
Dumbris merged commit aedfc21 into smart-mcp-proxy:main Oct 26, 2026
48 checks passed
@Dumbris

Dumbris commented Oct 26, 2026

Copy link
Copy Markdown
Member

Merged. Thank you, @rudycelekli! mcpproxy feedback exits non-zero when the backend rejects the submission.

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.

3 participants