Per-user summary paths and unified userName resolution#17
Merged
Conversation
…ill to credentials.json
…maries/{id}.md paths
efenocchi
added a commit
that referenced
this pull request
May 18, 2026
CodeRabbit #16/#17: two test files mutate process env (and one creates a tmp dir) inside `runHook(env)` calls without restoring them. Since `runHook()` only updates the env keys passed in, a test that sets e.g. `EMBEDDINGS_DISABLED_FOR_TEST=1` would leak the disabled state into every later test in the same vitest worker, making the suite order- dependent. The hermes test additionally leaves a tmp config dir on disk. Fix in both files: - Track the original value of each touched env key the first time `runHook()` mutates it (so re-mutation in the same test doesn't overwrite the snapshot with an intermediate value). - In `afterEach`, restore every captured key (delete if it was unset before, otherwise reassign) and clear the snapshot map for the next test. - For tests/hermes/hermes-capture-hook.test.ts: also track mkdtemp'd config dirs in `_tmpDirsToClean` and `rmSync` them in afterEach. No behavior change in the tests themselves; this is pure isolation hardening to remove the order-dependence CodeRabbit flagged.
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
/summaries/{userName}/{sessionId}.mdinstead of/summaries/{sessionId}.mdconfig.ts(creds.userName→ OS username →"unknown")capture.tsnow usesconfiginstead of readingcredentials.jsondirectly with its own fallbackuserNametocredentials.jsonfor old installs missing the field"user"fallbacks changed to"unknown"for easier debuggingTest plan
--plugin-dir— summaries land at/summaries/emanuele/index.mdrenders correct links for all sessionscredentials.jsonbackfill persists userName on first session-start