GeezerVison is showing github.com — mcpx: one durable task store across MCP and /v1 — Phase 1 of #1554 (#1555) by dezren39 · Pull Request #1575 · developing-today/code
mcpx: one durable task store across MCP and /v1 — Phase 1 of #1554 (#1555)
#1575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Generated by `internal/conformance` (`MCPX_UPDATE_MATRIX=1 go test ./internal/conformance -run TestMatrix`); do not edit.
Generated from inputs `1590f36a8ecf38c0` (sha256 of docs/spec/requirements.md, internal/conformance/overrides/*.json, internal/conformance/coverage*.go). `TestMatrix` regenerates this file and fails when it differs, so it describes the tree it is committed in.
Generated from inputs `4b10fd55ec788a13` (sha256 of docs/spec/requirements.md, internal/conformance/overrides/*.json, internal/conformance/coverage*.go). `TestMatrix` regenerates this file and fails when it differs, so it describes the tree it is committed in.
Every normative requirement of every revision (catalogue: `docs/spec/requirements.md`), for mcpx as a server and as a client. A requirement is *tested* when a named test verifies it in that revision, *n/a* when it does not bind mcpx in that role, and a *gap* when it binds mcpx and mcpx does not meet it yet, with the issue that tracks it. Run exactly the covering tests with `go run ./internal/conformance/cmd/covering`.
Expand DownExpand Up
@@ -58,7 +58,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| 2025-11-25 | client | SHOULD NOT | 5 | 4 | 1 | 0 | 9 |
| 2026-07-28 | server | MUST | 128 | 104 | 24 | 0 | 96 |
| 2026-07-28 | server | MUST | 128 | 105 | 23 | 0 | 96 |
| 2026-07-28 | server | MUST NOT | 44 | 41 | 3 | 0 | 20 |
| 2026-07-28 | server | SHOULD | 74 | 59 | 15 | 0 | 86 |
| 2026-07-28 | server | SHOULD NOT | 11 | 9 | 2 | 0 | 9 |
Expand DownExpand Up
@@ -2382,7 +2382,7 @@ Every normative requirement of every revision (catalogue: `docs/spec/requirement
| [ext-tasks-server-advertise-discover](https://modelcontextprotocol.io/specification/docs/extensions/tasks/overview.mdx#for-mcp-servers) | must (informal) | server | tested: `mcpserver.TestCapabilitiesPerRevision/2026-07-28/capabilities/tasks-only-as-extension` | n/a: addresses the other side |
| [ext-tasks-never-unsolicited](https://modelcontextprotocol.io/specification/docs/extensions/tasks/overview.mdx#for-mcp-servers) | must (informal) | server | tested: `mcpserver.TestTasksPerEra/2026-07-28/tasks/no-task-without-the-extension-task-param-ignored` | n/a: addresses the other side |
| [ext-tasks-server-decides](https://modelcontextprotocol.io/specification/docs/extensions/tasks/overview.mdx#why-not-just-block) | descr. | server | tested: `mcpserver.TestAQuestionAskedUpFrontIsAnsweredBeforeTheTaskExists@2026-07-28`<br>`mcpserver.TestATaskSupportingToolBecomesATaskWithoutWaitingTaskAfter@2026-07-28`<br>`mcpserver.TestTasksPerEra/2026-07-28/tasks/fast-call-is-answered-directly`<br>`mcpserver.TestTasksPerEra/2026-07-28/tasks/server-directed-CreateTaskResult-is-flat` | n/a: addresses the other side |
| [ext-tasks-durable-before-response](https://modelcontextprotocol.io/specification/docs/extensions/tasks/overview.mdx#for-mcp-servers) | must (informal) | server | **gap** #209: the task store is an in-memory map; a task does not survive the daemon | n/a: addresses the other side |
| [ext-tasks-durable-before-response](https://modelcontextprotocol.io/specification/docs/extensions/tasks/overview.mdx#for-mcp-servers) | must (informal) | server | tested: `mcpserver.TestInjectedStoreKeepsMCPTasksAcrossReopen@2026-07-28` | n/a: addresses the other side |
| [ext-tasks-createtaskresult-shape](https://modelcontextprotocol.io/specification/docs/extensions/tasks/overview.mdx#for-mcp-servers) | must (informal) | server | tested: `mcpserver.TestTasksPerEra/2026-07-28/tasks/server-directed-CreateTaskResult-is-flat` | n/a: addresses the other side |
| [ext-tasks-get-carries-result](https://modelcontextprotocol.io/specification/docs/extensions/tasks/overview.mdx#for-mcp-servers) | must (informal) | server | tested: `mcpserver.TestTasksPerEra/2026-07-28/tasks/server-directed-CreateTaskResult-is-flat`<br>`mcpserver.TestTasksPerEra/2026-07-28/tasks/tool-isError-is-completed-not-failed` | n/a: addresses the other side |
| [ext-tasks-get-input-requests](https://modelcontextprotocol.io/specification/docs/extensions/tasks/overview.mdx#how-tasks-work) | descr. | server | tested: `conformance.TestStatefulServer/2026-07-28/tasks/ext-tasks-get-input-requests` | n/a: addresses the other side |
The reason will be displayed to describe this comment to others. Learn more.
Delay loading tasks until the previous daemon stops serving
During takeover, this opens the task database before srv.TakeOver() transfers ownership and drains the predecessor's HTTP requests. tasks.Open() snapshots the rows and rewrites nonterminal tasks as failed, so a task completed by the predecessor between this initialization and handover remains incorrectly failed in the successor; tasks created during that interval are missing from its store entirely. An ordinary duplicate daemon startup also modifies the database before Listen() rejects it. Defer loading the store until the predecessor has stopped updating it.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
All reactions
// mcpx's own MCP server, on the listeners the daemon already has. Built
// here because the daemon cannot import the CLI that builds it, and
// mounted rather than given a listener of its own: two HTTP servers with
The reason will be displayed to describe this comment to others. Learn more.
Preserve the injected task store when adding extra tools
On the daemon's MCP path, this assignment is discarded before the server is returned: App.MCPServer() appends a.v1OpTools() and then calls srv.WithExtras(extras), whose new Server literal in internal/mcpserver/server.go does not copy TaskStore. Consequently, the daemon-served MCP server still creates a private in-memory store, so MCP tasks remain invisible through /v1 and disappear on restart. Preserve TaskStore in WithExtras, or perform the injection after that decoration; the new tests inject directly into an undecorated server and therefore miss this production path.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
All reactions
}
srv.PageSize = a.Settings().Int("mcp.pageSize")
srv.Passthrough = a.passNS()
// A function, because completion.maxValues is hot: the daemon's /mcp
Gap{ID: "tasks-resource-limits", Side: Server, Issue: "#209", Why: "no maximum ttl and no cap on concurrent tasks per requestor"},
Gap{ID: "tasks-audit", Side: Server, Issue: "#209", Why: "task creation, completion and retrieval are not logged"},
Gap{ID: "ext-tasks-cancel-cooperative", Side: Server, Issue: "#209", Why: "tasks/cancel forces the cancelled status rather than letting the work reach its own terminal status"},
Gap{ID: "ext-tasks-durable-before-response", Side: Server, Issue: "#209", Why: "the task store is an in-memory map; a task does not survive the daemon"},
Gap{ID: "caching-ttl-zero-stale", Side: Client, Issue: "#200", Why: "the client ignores ttlMs and cacheScope; the pool keeps upstream lists until list_changed or restart"},
Gap{ID: "caching-ttl-positive-fresh", Side: Client, Issue: "#200", Why: "the client ignores ttlMs and cacheScope; the pool keeps upstream lists until list_changed or restart"},
Gap{ID: "caching-ttl-absent-zero", Side: Client, Issue: "#200", Why: "the client ignores ttlMs and cacheScope; the pool keeps upstream lists until list_changed or restart"},
The reason will be displayed to describe this comment to others. Learn more.
Preserve connection ownership when restoring durable MCP tasks
After a daemon restart, the injected store restores MCP tasks but the server's taskOwners map is empty. visible() treats a missing owner as permission to access the task by ID, so a legacy task previously restricted to its originating connection becomes readable through tasks/get and tasks/result by any other connection that knows its ID. This bypasses the connection isolation explicitly enforced in requirements_test.go's another-connection-cannot-list-or-read-it test. Persist the ownership restriction alongside durable tasks, or otherwise deny foreign connections access to restored connection-owned tasks.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
t.Fatalf("task through the injected store: %v", done)
}
// A task still working when the store closes is the restart case.
working := store.Start(60000, func(context.Context) (any, *tasks.Fault) {
time.Sleep(2 * time.Second)
return "late", nil
})
if err := store.Close(); err != nil {
t.Fatal(err)
}
reopened, err := tasks.Open(path)
if err != nil {
t.Fatal(err)
}
defer reopened.Close()
got, ok := reopened.Get(id)
if !ok || got.Status != tasks.Completed {
t.Errorf("terminal MCP task after reopen: %+v, ok=%v", got, ok)
}
w, ok := reopened.Get(working.TaskID)
if !ok || w.Status != tasks.Failed ||
w.StatusMessage != "daemon restarted before task completion" {
t.Errorf("working task after reopen: %+v, ok=%v", w, ok)
}
}
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.