Repository navigation
fix: compute project name lazily for notification titles (#736) - #740
Merged
will-lamerton merged 2 commits intoAug 5, 2026
Merged
will-lamerton merged 2 commits into
will-lamerton merged 2 commits into
Conversation
…module-level projectName constant, which was evaluated once at load time and went stale after /cd. Notification titles now compute the project name at fire time inside sendNotification() instead, so they always reflect the current working directory. Closes Nano-Collective#736
DeepamJha
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
August 2, 2026 09:53
Member
|
Hey @DeepamJha - this is great but the changeset is empty, can you fill in please? :) |
Contributor
Author
|
@will-lamerton Good catch, just added a proper changeset summary. |
Contributor
Author
|
The CI failure is unrelated to this change, coverage threshold failing on fetch-models.ts, mcp-templates.ts, and provider-templates.ts, none of which this PR touches. Let me know if anything else is needed. |
2 tasks done
akramcodez
approved these changes
Aug 4, 2026
akramcodez
left a comment
Member
There was a problem hiding this comment.
LGTM great work @DeepamJha
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.
Closes #736
Description
projectNamewas previously captured once at module load time via atop-level
const projectName = basename(process.cwd()), and bakeddirectly into each notification title string in
EVENT_MESSAGES. Ifthe user changed directories mid-session with
/cd, notificationtitles kept showing the original folder name for the rest of the
session.
Fixed by changing
EVENT_MESSAGES[event].titlefrom a static stringto a function
(projectName: string) => string, and computingbasename(process.cwd())fresh insidesendNotification()rightbefore each notification fires — so titles always reflect the
current working directory, not the one at load time.
Type of Change
Changeset
pnpm changeset --empty)Testing
Automated Tests
pnpm test:all)Ran the suite on both
mainand this branch to isolate anyregressions:
maincurrently has 63 pre-existing failing testsunrelated to this change; this branch shows 64. Still confirming
whether that 1-test gap is caused by this change or is
flakiness/pre-existing — will update this PR if I find anything
notification-related.
Manual Testing
Reviewed the change against the reported repro steps in #736 — the
fix directly addresses the module-load-time evaluation described
in the issue.
Checklist