Validated follow-up: reparenting and async test fixes; upstream submission blocked - #8
Hylouis233 wants to merge 51 commits into
Conversation
Delegate coding tasks from MiniMax Code to locally installed coding CLIs (Claude Code, Codex, Kimi Code, ZCode, DSH) through a dependency-free stdio MCP server with git-diff review. See NOTICE for upstream credits.
- claude template gains --permission-mode acceptEdits so headless runs can actually edit files (verified end-to-end with Claude Code 2.1.226) - kimi keeps plain -p prompt mode: --auto/-y are mutually exclusive with -p on current Kimi Code versions - git snapshot now lists untracked files (git ls-files --others) so new files created by workers appear in changed files - README/SKILL document permission defaults and honest backend verification status
npm-style .ps1/.cmd shims cannot be spawned directly on Windows, so runCommand retries them through the bundled ps1-runner.ps1 (Windows PowerShell 5.1) with verbatim argument forwarding. README documents the fallback and the custom-wrapper caveat.
- per-workspace serialization of delegate_task - SIGTERM then SIGKILL force kill after timeout grace - snapshots include staged, untracked files and committed deltas - delegate_task marked destructiveHint, isError on failures - notifications/cancelled kills the worker - honest protocol version negotiation - fail closed when git snapshot commands fail - ring-buffer output capture without repeated large copies - README discloses supported operating systems
SKILL workflow and README tool description now cover before/after snapshots, committed deltas, same-workspace serialization, isError semantics, force-kill timeouts, and cancellation.
Seven self-contained tests cover protocol negotiation, tool list, snapshots, dirty-tree guard, unknown backends, cancellation, and before/after snapshots. SKILL wording now notes same-workspace serialization.
- workspace lock is now keyed by the canonical realpath of the git worktree root (git rev-parse --show-toplevel + fs.realpath), so the same checkout reached via a subdirectory, casing, or symlink shares one mutex (P1) - a delegation cancelled while queued for the lock re-checks the cancel flag after acquiring it and returns before spawning the worker (P1) - timeout and cancellation now terminate the whole process tree: taskkill /PID /T /F on Windows, signal to the detached process group on POSIX, instead of only killing the top-level child (P1) - git snapshots tolerate an unborn HEAD (fresh git init) and committedDelta reports the first commits when the worker started from no commits (P2) - codex templates delimit the prompt with -- so option-like tasks are not parsed as CLI flags (P2) - README comparison example now requires two independent git worktrees; the queued same-checkout second run is documented as follow-up work (P2) - SKILL resume guidance no longer implies results carry backend session ids Tests extended to 11 (protocol, tools, snapshots, dirty guard, unknown backend, in-flight cancel, before/after, worktree-root lock serialization, cancel-while-queued, unborn HEAD, codex -- delimiter); 3 consecutive runs green locally
- gitSnapshot/committedDelta executed their git commands via Promise.all; git status and git diff both refresh the index, so concurrent processes raced for .git/index.lock and intermittently failed with exit code 128, surfacing as random 'git snapshot unreliable' errors (reproduced 1-in-15 on Windows; the fail-closed guard turned it into a JSON-RPC error) - commands now run serially per repository; 10/10 Windows runs and a full npm run check in a Linux node:22 container pass - test harness: every server now stops in a finally block (a leaked server kept stdin/stdout pipes open and hung node --test when an assertion failed - the cause of the stalled CI validate job), in-flight cancel test bounds its worker with an explicit timeoutMs
…ribution - disclose repository concurrency: linked worktrees share refs, so snapshots detect other active leases plus completed runs' history records and mark attribution as potentially overlapping (repositoryConcurrency) - attribute only genuinely new commits: ranges exclude all pre-delegation refs, so a branch checkout is reported as a HEAD move with no new commits, and non-commit refs (blob tags) are reported without failing the run - verify process identity before signaling: Windows tracks creation times, POSIX groups are signaled only while the original leader identity matches, and reused PIDs are dropped from the tracked tree - make lease state updates interruptible by the request cancellation/deadline and resync the interrupted release by owner token - move quarantined leases to a recoverable state: removing the quarantine marker authorizes the next delegation to reclaim - catch process-tree inspection failures in the close handler (fail closed instead of an unhandled rejection) and slow the Linux /proc monitor to 250ms - tests: 55 total (checkout attribution, blob refs, concurrency disclosure, lease interruption, quarantined reclaim, PID-reuse identity)
- deduplicate HEAD and branch-ref targets so a commit on the checked-out branch is logged, diffed, and counted once with both labels - diff new refs from their merge-base with the pre-delegation state, so a branch forked from a divergent branch never attributes pre-existing differences to the worker - register list_backends in activeRequests and terminate a hanging version probe on cancellation, skipping the remaining probes - signal the process group when enumeration is unavailable (containment wins when identity cannot be verified) - strip only Git's line terminator from rev-parse --show-toplevel so a worktree root ending in whitespace canonicalizes correctly - tests: 60 total, all green locally
Add cross-process repository locking, fail-closed process containment, safe Git attribution, explicit quarantine recovery, Windows Job Object execution, and regression coverage for reviewed lifecycle and documentable safety boundaries.
…est script. These tests share git/tmpdir fixtures and deadline-sensitive waits, so they take turns via an exclusive directory lock while the repository-wide `node --test` runner stays file-parallel.
…ck so Node 22 file-parallel runs cannot skip-fail.
…so waiters return a structured MCP result.
Return structured lock-deadline MCP results and realpath-aware Trace2 worktree matching.
…Object containment.
Qualify the built-in Add-Type command without relaxing control/worker environment filtering. Compare short and long runtime paths by filesystem identity, bound test RPC/named-pipe waits, retain raw diagnostics, and isolate the complete Windows suite from root CI.
Normalize CRLF only, with LF/CRLF positive cases and negative cases for missing delimiters, mismatched names, and missing instructions. Keep all validation and containment checks enabled.
Submission follow-up — 2026-09-13Rechecked the published follow-up branch Searched upstream for an existing PR from this follow-up branch and found none. Then attempted to create the follow-up PR titled The proposed PR description explicitly distinguishes the September 11 exact-final-tree Linux/changed-Windows-file validation from the earlier complete Windows run. No tests were rerun during this submission check, and no new CodeQL, upstream-hosted validation, or production-platform support is claimed. Remaining action: submit the existing validated follow-up branch through an authorized account connection or the account owner's GitHub web session. This is a submission-permission blocker, not a request to repeat the original plugin PR or redo the already documented repairs. This historical validation PR remains closed without merging. No source, branch history, release, or deployment was changed by this follow-up. |
|
Final current-upstream integration — 2026-09-15 The goal remains an upstream maintenance contribution. Keep this historical validation PR closed; it is not the new upstream PR. Fresh run: https://github.com/Hylouis233/MiniMax-Code-Plugins-1/actions/runs/34949290063 — completed successfully on its first attempt at 2026-09-15T09:04:53Z. Exact inputs and verified identities:
The integration has no conflicts. Its only difference from current upstream is the original four bridge implementation/test files. No source-branch update or upstream merge was published. New results (not recycled September 11 results):
Both jobs use LF checkout for exact source-tree comparison. This is Linux whole-repository testing plus native Windows whole-plugin testing, not Windows whole-repository runtime testing, live vendor authentication testing, or additional production Linux/macOS support. The one-time workflow was removed from its separate audit branch in Upstream submission remains incomplete: this turn's actual Draft PR creation request returned HTTP 403 |
Final status — 2026-09-11
This author-owned validation PR remains closed without merging. Its historical PR head is not the current follow-up branch.
The original upstream contributions have been squash-merged:
04f2d42, merge1acf3b368ee8d110daf1f6c050faff20fc56993e, 2026-09-11T06:36:15Z.53b51f2, mergedda9e0b4e72e0fc4ff10c7cf938e89a732d25f2c, 2026-09-11T06:36:31Z.Those merges do not contain the later stability repairs. The new, clean follow-up is:
Hylouis233/MiniMax-Code-Plugins-1.fix/bridge-stability-20260911.a3aa17c5a58b95e4b1a37bc603f4bff6ea5453a9.dda9e0b4e72e0fc4ff10c7cf938e89a732d25f2c.a71f962,a3aa17c), only four changed files under cli-agent-bridge:process-tree.mjs,tests/process-tree.test.mjs,tests/server.test.mjs,tests/workspace-lock.test.mjs.04eed3dab7ac22fca0ecea5808429e0ca572d656.eac2902a283b73cbc431d91f5648ecbbc4c6a827.New upstream PR creation was actually attempted and returned
403 Resource not accessible by integration, including the final attempt with this fully validated head. No new upstream PR number exists. Submission still requires an account/API connection with the necessary upstream access. This record does not claim the follow-up is merged or submitted.Repairs and controlled comparisons
Production timeout behavior, Windows Job containment, root test concurrency, and the unsupported-POSIX production gate were not changed.
Final post-merge validation
Run 34575397571 validated the final indexed tree before publishing
a3aa17c. The published commit has the exact same root tree listed above.Earlier complete cross-platform coverage
Run 34572843946 tested the preceding three-file candidate
2553d839439bd87538b6c47ffa565e4b5c74199a, tree1bd5b91444984d11e86f28b827bbfa238fd094d5:That complete Windows run predates the final workspace-lock test-harness correction. Production bridge code and the other three test files are identical; the changed fourth test file was fully rerun on Windows in the final run. No fresh complete Windows run on the final root is claimed.
All results are author-fork hosted, not upstream-hosted or a fresh CodeQL result. The original
plugin/cli-agent-bridgebranch retains2553d839as work history; use the new follow-up branch for the next upstream PR.Historical failures retained and evidence limits
The reparenting defect has deterministic red/green evidence, but old intermittent tag-only/holder-response logs cannot establish the cause of every historical occurrence. No claim of universal absence of future timing failures or expanded POSIX support is made.
The eight temporary audit workflows/patch-staging files were removed from the isolated audit branch in cleanup commit
c2a8d116a5bf7fe36a187d521d8d890ef52980d6. Validated repair branches and historical test evidence were retained. No force push, upstream merge action, release, or deployment was performed by this follow-up.