Repository navigation
fix(mcp-server): every knowledge write says what the orchestrator did, and a refused daemon batch is retried - #409
Open
brianonbased-dev wants to merge 2 commits into
Conversation
…, and a refused daemon batch is retried task_1790588967474_xzgt: claude3-x402's re-read of #319 at bd05d52 (room msg_1790219322472_d0cjwe .. msg_1790219332311_ac825g), and the artifacts in C:\holo-dev\.scratch\claude3-review-artifacts\319b\. P2-A. team-routes wrote its mirror before the orchestrator, but no test pinned that order, and mutants N05/N21 survived all 269 tests. New test: the stand-in goes silent on the write only, and the team's knowledge is read while the POST is still waiting. Both rows must be there. It also checks the new warning line. P2-B. Four routes and a tool answered a refusal as success, though none keeps a copy of its own: - POST /contribute answered 201. - POST /knowledge/private answered 201. - POST /knowledge/promote answered 201 (not in the review's list, same class). - DELETE /knowledge/private/:id answered 200. - The holomesh_contribute tool answered success:true, synced:0. Each now answers 502 when the orchestrator refused and 503 when it could not be reached. The routes do this through one helper, answerUnacceptedWrite in holomesh/utils.ts, which #319's POST /knowledge now uses too; the tool says success:false. The error names the status and reason, never the orchestrator's text. holomesh_publish_tool stays a success, because its manifest really is published locally. It now says whether the knowledge copy landed. The daemon marked a batch contributed whatever the orchestrator answered, so a refused entry was never retried. Both daemon sites now mark nothing unless every row was taken. P3, in the client: - An answer saying success:false with no count is no longer read as the whole batch accepted. - A leading byte-order mark is stripped before JSON.parse. - An answer over 64 KiB is named as that, not as "without a JSON body". - The timeout setting is clamped. Node's AbortSignal.timeout throws on values above 2^32-1, and every request then read as unreachable. - The team route logs one line (count and reason, no body) when its rows live only in the mirror. Not done: the test's stand-in port does not retry on EADDRINUSE. The port is fixed before import (vi.hoisted), and a retry would need a restructure; the collision odds are about 1 in 20,000 per run. Verified: - 10 new tests fail before the fix, and 1 new daemon test fails on the old daemon. The ordering test passes on the correct order: it is a pin. Controls stay green: accepted writes still answer 201/200, and the tool still succeeds. - The outcome, client and daemon test files: 117/117. - Each part broken alone: 13 of 13 red, each on its own test. The parts are: the mirror order, the helper, each of the four routes, the tool, the daemon, success:false, the byte-order mark, the oversized answer, the clamp, and the log line. - tsc 0 errors. The files that were prettier-clean stay clean. The outcome test file was already unformatted from #319; it is formatted on its own in the next commit. Stacked on #408 (claude1/orchestrator-client-timeouts): the two changes share the test file and the client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…formatting only) The file has been unformatted since #319. Kept apart from the fix so the fix reads as its own delta. prettier --write, nothing else; 24/24 still pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
triage 2026-10-05: open-cap ≤5; recreate from main if needed |
Owner
Author
|
reopened 2026-10-05: Joseph GO — security/hosted-server triage restore |
Owner
Author
HoloCI verdict: FAILHoloCI checked the head commit of this pull request with the
Fix the failed gates and push. HoloCI checks the new head commit on its own. |
This branch has not been deployed
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.
What this fixes
Four knowledge routes and one MCP tool answered success when the orchestrator refused the write, although none of them keeps a copy of its own. The caller was told something was saved that exists nowhere. The daemon also marked a refused batch as contributed, so it was never retried.
Task:
task_1790588967474_xzgt(claude3's re-read of #319). Stacked on #408, since they share the client and the test file. Merge #408 first, then retarget this to main.The change
POST /contribute,POST /knowledge/private,POST /knowledge/promoteandDELETE /knowledge/private/:idanswer 502 on a refusal and 503 when the orchestrator is unreachable. This goes through one helper,answerUnacceptedWrite, which fix(mcp-server): a knowledge write reports what the orchestrator accepted and names a refusal (w6ui) #319'sPOST /knowledgenow shares.holomesh_contributetool sayssuccess: falseand why.holomesh_publish_toolstays a success, since its manifest is local, and now reports whether the knowledge copy landed.{success:false}with no count is not acceptance.Proof
Not done: the stand-in port does not retry on EADDRINUSE. The port is fixed before import; the odds are about 1 in 20,000 per run.
Needs a distinct-seat review (author: claude1 / claudecode-x402).
🤖 Generated with Claude Code