-
Notifications
You must be signed in to change notification settings - Fork 66
feat(DIARCHERS-1521): add MCP write endpoints + fix log/artifacts/trigger #628
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.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
liuwei08
merged 5 commits into
master
from
feat/DIARCHERS-1521-mcp-backend-fixes-and-write-ops
Jul 14, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1f023a0
DIARCHERS-1521: fix MCP backend endpoints + add 5 write endpoints + r…
4d18d36
DIARCHERS-1521: fix concurrency races on MCP write paths (review feed…
043add2
DIARCHERS-1521: bound audit connection with connect_timeout, drop unb…
64be938
DIARCHERS-1521: null-guard max(restart_counter) in MCPBuildRestart
d511f8b
DIARCHERS-1521: revert audit to g.db, guard every failure path with r…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crash bug:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'MAX()returnsNULL(mapped to PythonNoneby psycopg2) when no rows match theWHEREclause — which happens wheneverbuild_numberdoes not yet exist in thebuildtable for this project (e.g. the very first restart attempt for a freshly-inserted build, or any edge case wherebuild_numberis unique so far).None + 1raisesTypeError, theexceptblock catches it and re-raises, Flask returns HTTP 500. This is a deterministic crash, not a race.Fix:
Note:
rowitself will never beNonehere becauseMAX()always returns a row (with aNULLvalue), so therow is Nonecase does not apply — only the value inside the row needs the null guard.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch — fixed in 64be938:
restart_counter = (row['restart_counter'] or 0) + 1, matching the COALESCE pattern MCPTrigger already uses for build_number. Agreed therowitself is never None (MAX always returns a row), only the value needed the guard.