Fix data races, credential leaks, and correctness issues#91
Open
shawnburke wants to merge 2 commits intomainfrom
Open
Fix data races, credential leaks, and correctness issues#91shawnburke wants to merge 2 commits intomainfrom
shawnburke wants to merge 2 commits intomainfrom
Conversation
- Add sync.RWMutex to RegistrationReflector targets map (concurrent map panic) - Use atomic.Bool for Supervisor killed/done flags (data race) - Fix signal handler leak: call signal.Stop on command exit - Mask tokens in debug logs to prevent credential exposure - Remove SNYKBROKER_ env var values from debug logs - Fix double WriteHeader in reflector ServeHTTP and handleSystemCheck - Guard against panic on short CortexApiToken in Print() - Handle Restart() error and write response in handleReregister - Convert panics to returned errors in relay_instance_manager - Add sync.RWMutex to handlerManager maps for concurrent safety - Sanitize handler name with filepath.Base in history path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shawnburke
commented
Mar 15, 2026
Both the custom headers check and accept file write panics are intentional — the agent should not start with invalid configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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 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.
Summary
sync.RWMutextoRegistrationReflector.targetsmap andhandlerManagermaps to prevent concurrent map panics. Useatomic.BoolforSupervisor.killed/doneflags.SNYKBROKER_env var values from log output.WriteHeadercalls in reflector andhandleSystemCheck. FixhandleReregisterto checkRestart()error and write response. Convert twopanic()calls inrelay_instance_managerto returned errors. GuardPrint()against short API tokens. Fix signal handler goroutine leak inSupervisor. Sanitize handler names in history file paths withfilepath.Base().Issues addressed
targetsmap data race inRegistrationReflectorkilled/donedata races inSupervisorWriteHeaderin reflectorServeHTTPWriteHeaderinhandleSystemCheckPrint()handleReregisterignoresRestart()errorSupervisorpanic()→ returned errors in relay instance managerSNYKBROKER_env vars logged with valueshandlerManagermapsTest plan
go build ./...passesgo vet ./...passesgo test ./...passes (all packages)🤖 Generated with Claude Code