Skip to content
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
rachellerathbone merged 1 commit into
mainfrom
fix-files-base-url-proxy-restart-pid
Jun 29, 2026
Merged

fix(files): resolve base URL for proxy spawn, respawn on restart, reap stale pidfiles#184
rachellerathbone merged 1 commit into
mainfrom
fix-files-base-url-proxy-restart-pid

Conversation

@rachellerathbone

Copy link
Copy Markdown
Contributor

Summary

  • Resolve the Shield API base URL once for files (--base-url > MULTICORN_BASE_URL > config.json > default) and pass it into the local proxy spawn env as SHIELD_API_BASE_URL, so registration and proxy auth target the same backend.
  • files restart now respawns the shared proxy instead of reusing a healthy process that still points at the old base URL.
  • Stale files-<agent>.pid files are reaped when the supervisor pid is dead (process.kill(pid, 0)), including legacy pidfiles that stored the pid under pid instead of supervisorPid.

Test plan

  • pnpm test src/commands/files-defect-fixes.test.ts
  • pnpm test (full suite)
  • pnpm typecheck
  • Clean start with --base-url http://localhost:8080: proxy log shows local base URL, registration succeeds, no 401 on tool calls
  • files restart --agent <name> --base-url http://localhost:8080 after switching base URL: logs show new proxy start, not "Reusing shared proxy"
  • Kill supervisor manually, leave pidfile: next files start proceeds without "already running"

Made with Cursor

…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>
@rachellerathbone
rachellerathbone merged commit e31c648 into main Jun 29, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant