Repository navigation
fix(mcpx): #6247 refresh task retention on the MCP access path - #6332
Conversation
|
Warning Review limit reachedYou'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 38 minutes. View limit details
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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5eaa859c07
ℹ️ 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".
| srv.TaskRetention = func() (time.Duration, time.Duration) { | ||
| return a.Settings().Duration("tasks.ttl"), a.Settings().Duration("tasks.maxAge") | ||
| } |
There was a problem hiding this comment.
Preserve the retention provider through WithExtras
In the production App.MCPServer construction path, this provider is discarded before the server is returned: serve.go:607-622 appends the generated /v1 tools and calls srv.WithExtras(extras), whose new Server literal in mcpserver/server.go:383-403 does not copy TaskRetention. Consequently, the returned MCP server still has a nil provider, so /v1/settings retention changes never reach MCP-only traffic despite this fix. Preserve the provider through that reconstruction and add a regression covering the extras construction path; the new test assigns the provider directly and bypasses it.
AGENTS.md reference: pkgs/mcpx/internal/AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in commits 3ebac48 + 9e7f4e1 (gofmt): WithExtras now copies TaskRetention — and, same seam and same class, TaskStore and TaskAudit, which the reconstruction was also dropping (silently giving the production extras server a private store, breaking #1555 sharing whenever extras exist). New regression TestRetentionSurvivesWithExtras builds the server exactly as App.MCPServer does (inject store + provider, then WithExtras) and verifies MCP-only traffic picks up the retention change in the injected store.
@codex review
There was a problem hiding this comment.
Codex Review: Didn't find any major issues. More of your lovely PRs please.
Reviewed commit: 9e7f4e101f
ℹ️ 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".
Implements issue #6247 (task 10657), the Codex P2 from PR #5754.
Problem: the daemon refreshes task retention (
tasks.ttl/tasks.maxAge) only in its owntaskStore()accessor (daemon/ops.go). The MCP server holds a cached pointer to the same store and never calledConfigure, so a/v1/settingsretention change never took effect for MCP-only task traffic.Fix, following the existing
MaxCompletionshot-setting pattern:mcpserver.ServergainsTaskRetention func() (ttl, maxAge time.Duration).tasks()now callsstore.Configure(ttl, maxAge)from the provider on every access when the provider is set — the same refresh the daemon performs for /v1.Configureignores nonpositive values, so a zero provider result leaves the configuration alone.cli.MCPServer()wires the provider from the app settings (tasks.ttl,tasks.maxAge) whenever the daemon's store is injected.Test:
TestMCPOnlyTrafficPicksUpRetentionChangein tasks_shared_store_test.go — after changing the provider's maxAge from 1h to 2s and exercising only the MCP path, a newly completed task's retention deadline is bounded by the new value.Closes #6247.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.