fix(agentconfig): distinguish IsNotExist from other errors + chore(aep): remove dead code#99
Merged
hrygo merged 1 commit intohrygo:mainfrom May 1, 2026
Conversation
Modified readFile to return (string, error) instead of string, properly distinguishing between IsNotExist errors (silent skip) and other errors like permission denied (propagate to caller). Updated loadFile and Load to handle errors via new loadFileWithErrorCount helper. Added test case TestLoad_PermissionError to verify error propagation. chore(aep): remove dead EncodeChunk function Removed EncodeChunk function and its test cases (TestEncodeChunk, TestEncodeChunk_NDJSONSafe). The function was only used in tests and provided no value over the existing Encode function. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #99 +/- ##
==========================================
- Coverage 59.58% 59.54% -0.04%
==========================================
Files 134 134
Lines 15969 15979 +10
==========================================
Hits 9515 9515
- Misses 5860 5867 +7
- Partials 594 597 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
This PR implements two architecture improvements from the selected issues:
fix(agentconfig):
readFileerror handling (fix(agentconfig): readFile swallows all os.ReadFile errors including permission denied #80)readFileto return(string, error)instead ofstringIsNotExisterrors (silent skip) and other errors like permission denied (propagate to caller)loadFileandLoadto handle errors via newloadFileWithErrorCounthelperTestLoad_PermissionErrorto verify error propagationchore(aep): remove dead
EncodeChunkfunction (chore(aep): remove dead EncodeChunk function #75)EncodeChunkfunction (duplicate ofEncode)TestEncodeChunkandTestEncodeChunk_NDJSONSafeVerified Already Implemented
The following issues were verified as already implemented in the codebase:
errgroupinTerminateAllWorkers()sseCancelfield and proper mutex protectionSkipped
applyMessagingEnvDRY violation (chore(config): applyMessagingEnv DRY violation — 20 repetitive env var mappings #72) - Skipped due to complexity and risk of introducing bugsTest Plan
make test)make lint)make fmt)make quality)Architecture Impact
Related Issues
Closes #80 (partially - error handling only)
Closes #75
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com