Skip to content

mcpx(daemon): bound chat proxy upstream calls (#2114) - #3380

Merged
dezren39 merged 4 commits into
mainfrom
queue/3088-2114-proxy-timeout
Nov 3, 2026
Merged

dezren39 merged 4 commits into
mainfrom
queue/3088-2114-proxy-timeout

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add daemon setting proxy.timeout (10m default) and use it for the complete upstream request. Failures before response headers return 502.
  • Cap the feedback-record copy at 1 MiB with a visible truncation marker, without truncating the response forwarded to the caller.
  • Keep optional legacy proxy.* reads safe when they are absent from the settings schema.

Evidence

  • Before: focused tests showed a stalled upstream returned 200 after 1s instead of 502, and the streamed response feedback copy had no truncation marker.
  • After: go test ./internal/daemon -run 'TestProxy(UpstreamTimeoutReturnsBadGateway|CapsFeedbackCopyAndForwardsFullStream)' -count=1 passed; go test ./internal/e2e -run TestProxyUpstreamTimeoutIsReachableFromTheEnvironment -count=1 passed; focused settings/docs tests passed.
  • The latest full daemon run hit TestKeepAliveCallersLoseNoCallsAcrossATakeover: takeover EOF; that test passed when run alone on clean main. An earlier full daemon run passed.
  • Full settings tests retain unrelated failures also reproduced on clean main (manifest/env/effect coverage).

Merge Danger

Door: two-way.

Blast Radius: low — only the daemon chat-completions proxy deadline and feedback capture are affected.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 06:55
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ea49e3b8-51a5-4b8e-8d47-52a7028f3c39
Commits

Reviewing files that changed from the base of the PR and between 80b06f8 and 90bb132.

Files selected for processing: 14
  • pkgs/mcpx/docs/changes/proxy-timeout.md
  • pkgs/mcpx/docs/compendium.manifest.json
  • pkgs/mcpx/docs/configuration.md
  • pkgs/mcpx/internal/daemon/routes_proxy.go
  • pkgs/mcpx/internal/daemon/routes_proxy_test.go
  • pkgs/mcpx/internal/defaults/defaults.go
  • pkgs/mcpx/internal/defaults/defaults.json
  • pkgs/mcpx/internal/e2e/effect_test.go
  • pkgs/mcpx/internal/e2e/proxy_test.go
  • pkgs/mcpx/internal/settings/effect.go
  • pkgs/mcpx/internal/settings/proxy.go
  • pkgs/mcpx/internal/settings/proxy_test.go
  • pkgs/mcpx/internal/settings/registry.go
  • pkgs/mcpx/internal/settings/value.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T23:12:57.561155Z 90bb132 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 force-pushed the queue/3088-2114-proxy-timeout branch from dbe4fff to 562db2a Compare November 3, 2026 21:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 562db2ac63

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1 to +3
sections: proxy
kind: Added
summary: configuration.md gains the proxy section (#2114): the new proxy.timeout setting (duration, 10m default, --proxy-timeout / MCPX_PROXY_TIMEOUT) that bounds how long the daemon waits for a chat-completions upstream, returning 502 when the deadline passes before response headers

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Register the new history fragment in the compendium manifest

The new Markdown fragment has no entry in docs/compendium.manifest.json, so it introduces a failure in TestEveryDocumentHasAChapter. That test walks all module Markdown files, including docs/changes/, and reports any file absent from the manifest (internal/settings/compendium_test.go:123–166). Add an entry for this fragment, using the not-compendium role if appropriate for release-history fragments. This also follows the explicit documentation-registration requirement in internal/AGENTS.md.

AGENTS.md reference: pkgs/mcpx/internal/AGENTS.md:L17-L18

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 90bb132 (pushed to queue/3088-2114-proxy-timeout): added the docs/changes/proxy-timeout.md entry to pkgs/mcpx/docs/compendium.manifest.json with role not-compendium, matching the other docs/changes fragments. Verified on the laptop: TestEveryDocumentHasAChapter no longer lists proxy-timeout.md; its 4 remaining unregistered files (TESTING.md, docs/changes/docs-history-tool.md, docs/changes/protocol-capability-claims.md, docs/changes/research-and-findings-chapter.md) are identical on clean main — pre-existing, not introduced by this PR. Disposition by queue task 8803 (repo-worker-code, lane code-f).

…fest (#2114)

Codex P1 on PR #3380 (comment 4460883082): docs/changes/proxy-timeout.md had no manifest entry, failing TestEveryDocumentHasAChapter for the PR-introduced file. Entry added with role not-compendium, matching the other docs/changes fragments. The test still lists 4 pre-existing unregistered files (TESTING.md and 3 older fragments) — identical on clean main, not this PR.

Task 8803.
@dezren39

dezren39 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 90bb132817

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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