Skip to content

Keep the text after a bare Windows home path in a Bot's bug report - #1948

Merged
Fei2411 merged 3 commits into
devfrom
fix/issue-report-windows-home
Nov 21, 2026
Merged

Fei2411 merged 3 commits into
devfrom
fix/issue-report-windows-home

Conversation

@Fei2411

@Fei2411 Fei2411 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Issue

Follow-up to #1942 (a non-blocking note in its Code Reaper review). In a Bot's bug report draft, a Windows home path with no trailing separator also hid the rest of the sentence: C:\Users\Jane Doe and more text became ~.

What changed / 改了什么

  • issue-report.js: when an unquoted bare Windows home path is followed by a common conjunction (and, or, but, then, because, while, when), the redaction now keeps the text from that word on. C:\Users\Jane Doe and more text becomes ~ and more text.
  • These cases are still fully redacted: quoted names, paths that have a separator after the name, and names with spaces at the end of a sentence.
  • Tradeoff: an unquoted profile name that itself contains one of those words is split at that word. Quoting the path avoids this.
  • view-reply.test.js: regression tests check both the approval preview and the fallback URL.

Changelog

A Bot's bug report no longer drops the text that follows a Windows home path.

How I checked it / 怎么验证的

  • npm test (in ds-bot/): 3590 passed, 0 failed, 4 skipped
  • node scripts/build-client.mjs --check
  • npm run lint
  • Smoke test, for changes to index.js or src/host/: all 56 steps passed
  • Screenshot attached, for interface changes: not applicable, no interface change

Checklist / 检查

  • One issue, one subject. / 只做一件事。
  • src/client/ changed → npm run build ran and client.js is committed. / 改了 src/client/ 就已重新 build 并提交 client.js。 (not applicable: src/client/ is unchanged)
  • No keys, tokens or personal data, also in screenshots. / 没有密钥、token 或个人信息,截图里也没有。
  • No AI tool as author or Co-authored-by. / 没有把 AI 工具写成作者或 Co-authored-by。

Agent: Devin (Cognition)


Product Engineer opened this PR for Lulu
Implemented in session Add self-reporting issue skill to DS-Bot
Review with Devin · Open in Devin Desktop


Stop unquoted bare-home redaction at common clause boundaries while retaining full redaction for quoted names and paths with a directory separator.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T09:08:43.122208Z affe166 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Treat an opening quote or bracket as a path boundary even when punctuation ends the match before the closing delimiter.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 finding. Devin automatically fixed it.

Fixed by Devin (1)
  • Quoted Windows profile names leak — An opening quote, parenthesis or bracket before the path now always redacts the whole name; regression test added.

View findings in Devin Review · Follow Devin's work

Devin Review

@Fei2411 Fei2411 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Reaper review: fail (head 62609420, comments only)

Fixing the over-redaction was the right call, and the quote/bracket guard works: "C:\Users\Jane Doe and more" → "~" and (C:\Users\Jane Doe and more) → (~). CI shows 7 passed. Locally, view-reply, connectors and privacy tests pass 52/52, build-client --check passes, and lint shows no errors.

Blocking: when two bare Windows home paths are in one sentence, the second username is published. The bare-name branch of WINDOWS_HOME can match the drive letter of the next path, because : is in the closing lookahead, so the regex never sees the second C:\Users\…:

input dev (from #1942) this head
C:\Users\Jane Doe then C:\Users\Bob Ray or so ~:\Users\Bob Ray or so ~ then C:\Users\Bob Ray or so
C:\Users\Jane Doe and C:\Users\Bob Ray ~:\Users\Bob Ray ~ and C:\Users\Bob Ray
(C:\Users\Jane Doe then C:\Users\Bob Ray) (~:\Users\Bob Ray) (~:\Users\Bob Ray)

This bug predates this PR, but this PR is the redaction follow-up, it keeps the bug, and the leaked name goes into a public issue. The fix is to stop the bare name from crossing into another drive path:

// in WINDOWS_HOME, bare-name alternative
(?:(?![A-Z]:[\\/])[^\\/:*?<>|\s'"\x60.,;)\]-]|-(?!>)|\.(?!$|[\s.,;:)\]'"\x60])| )+

With that lookahead, the three rows become ~ ~ or so, ~ ~ and (~ ~). C:\Users\Jane Doe and more text → ~ and more text, C:\Users\Jane Doe. → ~. and C:\Users\John Smith\AppData → ~/AppData still pass. Please add a two-path regression test.

Non-blocking:

  • As the PR body says, a profile name that contains one of the listed words is split at that word: C:\Users\Rock and Roll then failed → ~ and Roll then failed. That's acceptable, since the user sees the card before approving.
  • <C:\Users\Jane Doe and x> → <~ x> drops the word "and". This hides too much rather than too little.

Overlaps: none. This PR only touches issue-report.js and view-reply.test.js, and #1942 is already in dev.

Stop a bare home match before the next drive prefix so preserved prose cannot prevent redaction of another profile.

@Fei2411 Fei2411 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Reaper re-review — Verdict: pass (head 17bf0d3c, comments only)

The two-path leak is fixed: the bare-name branch now stops at (?![A-Z]:[\\/]), so each Windows home is redacted on its own. The new test covers the three inputs from my last review plus the three cases that must keep working.

Extra probes:

  • C:\Users\Jane Doe D:\Users\Bob Ray → ~ ~
  • C:\Users\Jane Doe then D:/Users/Bob Ray/x → ~ ~/x
  • C:\Users\A, C:\Users\B and C:\Users\C D → ~, ~ ~
  • "C:\Users\Jane Doe then C:\Users\Bob Ray" → "~ ~"
  • A 60k-character adversarial input runs in under 1 ms.

Checks: CI 7 passed. Locally, view-reply, connectors and privacy tests pass 53/53, build-client --check passes, and lint has no errors.

Non-blocking, edge cases only:

  • When two paths run together with no space between them, the name is only partly hidden: C:\Users\Jane DoeC:\Users\Bob → ~ DoeC:\Users\Bob. The old code also leaked here, and real text rarely looks like this.
  • C:\Users\Jane Doe then C:\tmp\x → ~ C:\tmp\x drops "then". That only over-redacts.

Overlaps: none. The PR touches only issue-report.js and view-reply.test.js.

@Fei2411
Fei2411 merged commit c9dee2e into dev Nov 21, 2026
27 of 29 checks passed
@Fei2411
Fei2411 deleted the fix/issue-report-windows-home branch November 21, 2026 09:38
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