This repository was archived by the owner on Jul 19, 2026. It is now read-only.
fix(files): resolve base URL for proxy spawn, respawn on restart, reap stale pidfiles - #184
Merged
Merged
Conversation
…p stale pidfiles Local files setup was registering agents against one API base while the spawned proxy defaulted to production, causing 401s with locally minted keys. Restart also reused a healthy proxy with the old base URL, and dead supervisors could leave pidfiles that blocked clean starts. Co-authored-by: Cursor <cursoragent@cursor.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
files(--base-url>MULTICORN_BASE_URL> config.json > default) and pass it into the local proxy spawn env asSHIELD_API_BASE_URL, so registration and proxy auth target the same backend.files restartnow respawns the shared proxy instead of reusing a healthy process that still points at the old base URL.files-<agent>.pidfiles are reaped when the supervisor pid is dead (process.kill(pid, 0)), including legacy pidfiles that stored the pid underpidinstead ofsupervisorPid.Test plan
pnpm test src/commands/files-defect-fixes.test.tspnpm test(full suite)pnpm typecheck--base-url http://localhost:8080: proxy log shows local base URL, registration succeeds, no 401 on tool callsfiles restart --agent <name> --base-url http://localhost:8080after switching base URL: logs show new proxy start, not "Reusing shared proxy"filesstart proceeds without "already running"Made with Cursor