Skip to content

[Bug] Paste placeholder ID collides with file mention IDs #969

Closed

Description

@akramcodez

Description

Paste placeholder IDs use bare numbers ("1", "2"), but file mentions also use numeric IDs in the same placeholderContent map, leading to collisions where pasting overwrites file mentions.

Environment

  • OS: (e.g., macOS 14.0, Ubuntu 22.04, Windows 11)
  • Node version: (run node --version)
  • Nanocoder version: (run nanocoder --version)
  • Provider: (e.g., Ollama, OpenRouter, OpenAI-compatible API)
  • Model: (e.g., llama3.2, claude-3.5-sonnet)

Steps to Reproduce

  1. Mention a file which generates a placeholder ID of "1".
  2. Paste text that triggers a paste placeholder generation.
  3. The paste logic in source/utils/paste-utils.ts assigns ID "1".

Expected Behavior

Paste IDs should be properly namespaced (e.g. paste_1) so they do not collide with file mentions.

Actual Behavior

The newly pasted placeholder overwrites the existing file mention in the map.

Logs/Screenshots

N/A

Additional Context

  • 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 27, 2026
  2. arpan7sarkar commented on Aug 27, 2026

    @arpan7sarkar
    Contributor

    Hey @akramcodez assign me this issue so i can fix this one .

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