Skip to content

Per-user summary paths and unified userName resolution#17

Merged
efenocchi merged 14 commits into
mainfrom
feature/integrate-wasm
Apr 7, 2026
Merged

Per-user summary paths and unified userName resolution#17
efenocchi merged 14 commits into
mainfrom
feature/integrate-wasm

Conversation

@efenocchi
Copy link
Copy Markdown
Collaborator

Summary

  • Summary paths now use /summaries/{userName}/{sessionId}.md instead of /summaries/{sessionId}.md
  • Unified userName resolution: single fallback chain in config.ts (creds.userName → OS username → "unknown")
  • capture.ts now uses config instead of reading credentials.json directly with its own fallback
  • Session-start backfill persists userName to credentials.json for old installs missing the field
  • All "user" fallbacks changed to "unknown" for easier debugging
  • Version bump to 0.3.2

Test plan

  • 3 test questions with --plugin-dir — summaries land at /summaries/emanuele/
  • Follow-up (resumed session) merges into existing summary correctly
  • index.md renders correct links for all sessions
  • credentials.json backfill persists userName on first session-start
  • All 108 tests pass

@efenocchi efenocchi merged commit b2bc01f into main Apr 7, 2026
2 checks passed
@efenocchi efenocchi deleted the feature/integrate-wasm branch April 7, 2026 22:49
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant