Skip to content

[Bug] Notification Title Shows Stale Project Name After cd in Session #736

Closed

Description

@akramcodez

Description

The projectName variable used in desktop notification titles is evaluated once at module load time via basename(process.cwd()). If the user changes directory during a session (which Nanocoder supports), the notification title will continue showing the original directory name for the rest of the session instead of the current one.

Environment

  • OS: macOS or Linux (any platform with notifications enabled)
  • Node version: Any
  • Nanocoder version: Latest
  • Provider: Any
  • Model: Any

Steps to Reproduce

  1. Start Nanocoder in directory /home/user/project-a.
  2. Enable desktop notifications in preferences.
  3. Use the /cd command (or equivalent) to change into /home/user/project-b.
  4. Trigger a notification (e.g., let an agent complete a generation).
  5. Observe the notification title still reads "Response Ready in project-a".

Expected Behavior

The notification title should reflect the current working directory at the
time the notification fires, e.g., "Response Ready in project-b".

Actual Behavior

The notification title shows the directory name from when the module was first
loaded, not the current one.

Logs/Screenshots

N/A

Additional Context

  • Fix: replace the module-level const projectName = basename(process.cwd()) with an inline call basename(process.cwd()) inside each title string in EVENT_MESSAGES, or compute it lazily inside sendNotification().
  • Note: This issue is intentionally kept small and is suitable for first-time contributors. If you're interested in working on it, please leave a comment below and ask to be assigned before opening a pull request.
  • I have searched existing issues to ensure this is not a duplicate
  • I can reproduce this issue consistently
  • This issue occurs with the latest version of nanocoder

Activity

  1. added
    bug
    good first issue
    on Aug 1, 2026
  2. MsadafK commented on Aug 1, 2026

    @MsadafK

    Hi @akramcodez , I would like to work on this issue. Please assign it to me!

  3. DeepamJha commented on Aug 1, 2026

    @DeepamJha
    Contributor

    Hi @akramcodez, I'd like to work on this. My approach is simple as right now projectName only gets read once when the app first starts, so if you /cd somewhere else, the notification still shows the old folder name. Proposed fix is just to grab the folder name fresh each time a notification actually goes out, instead of storing it once at the start

  4. added 2 commits that reference this issue on Aug 2, 2026
    c3e7638
    5d3f21a
  5. added a commit that references this issue on Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions