Skip to content

Let a Bot report a DS Bot bug as a GitHub issue after the user approves a card - #1942

Merged
Fei2411 merged 11 commits into
devfrom
feat/self-report-issue
Nov 21, 2026
Merged

Fei2411 merged 11 commits into
devfrom
feat/self-report-issue

Conversation

@Fei2411

@Fei2411 Fei2411 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Issue

No issue; requested by the maintainer (many users hit problems but never report them).

What changed / 改了什么

  • New bundled skill report-ds-bot-issue (registered next to goal-grill in goal-skills.js): when a user hits a DS Bot bug or asks to report one, the Bot checks for duplicates when possible, drafts a report following .github/ISSUE_TEMPLATE/bug.yml, and routes security reports to GitHub's private advisory form.
  • issue-report.js: the host builds the draft (DS Bot/DSH versions, OS), strips known secrets and home paths (shared redaction from diagnostics.js), and binds the exact draft to the Bot's existing show_view confirm card.
  • channel.js / tools.js / parts.js: only the matching affirmative view-reply on that card, durably claimed once, authorizes one GitHub write. Typed replies, dismissal, cancel, replacement and replays cannot.
  • connectors/index.js: the write uses the Bot's existing GitHub connector credential, only for Fei2411/DS-Bot, and respects sign-in, per-Bot access and read-only mode. Without a usable connection it returns a length-capped prefilled issues/new link for manual submission. The Bot gets back the issue URL.
  • Design note: docs/plans/self-report-issue.md. No client UI changes.

Changelog

Bots can draft a DS Bot bug report and, after you approve it on a card, open it as a GitHub issue for you.

How I checked it / 怎么验证的

  • npm test (in ds-bot/): 3529 pass, 0 fail
  • node scripts/build-client.mjs --check
  • npm run lint
  • Smoke test (mock bench): all 56 steps passed
  • Screenshot attached, for interface changes (no interface change; reuses the existing confirm card)

New tests in view-reply.test.js and connectors.test.js cover approval, cancellation, replay, redaction, connector restrictions and the fallback link. Not done: a live GitHub write.

Checklist / 检查

  • One issue, one subject.
  • src/client/ not changed.
  • No keys, tokens or personal data.
  • No AI tool as author or 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


Bind the prepared draft to the card so only a matching confirmation can send it to GitHub. Reuse the existing connector and offer a prefilled link when it cannot publish.
Record the approval and connector boundaries without adding a new interface.
@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-21T08:14:53.224979Z d3fdecc 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.

Open the repository’s configured bug template instead of its disabled blank issue form, keeping the approved fields in the capped fallback URL.
devin-ai-integration[bot]

This comment was marked as resolved.

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Normalize public drafts’ Unix and Windows home prefixes without changing the existing Feedback diagnostics.
Search between field completions so removing an encoded ellipsis cannot hide a longer valid link.
Keep both Unix variants covered without treating example paths as personal data in the tracked-tree leak scan.
Treat whitespace and quotes as username boundaries so a rename error cannot consume its destination path.
Allow spaced profile names while stopping at quotes, newlines and invalid Windows filename characters.
@Fei2411

Fei2411 commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

Tested a2f5cc3a end-to-end in the web UI using an isolated mock bench. No real GitHub write was made.

  • Draft preview renders with Publish issue / Cancel.
  • macOS, Linux and Windows home paths (including a Windows username with spaces) and a synthetic token are redacted in both the draft and fallback URL.
  • Cancel does not publish.
  • Publish without a connector returns a template=bug.yml URL with title, what, steps and diagnostics filled in.
  • Repeat clicks on the completed card do nothing; replaying the used view-reply over HTTP returns ok:false, bot/stale.

Not tested: GitHub's rendered form behind sign-in, connector-backed publication, and real-model skill selection.

Recording

Written by Devin

@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 — Verdict: pass (head 2a524f2d, comments only)

I checked the approval path end to end in code. Only a view-reply whose action is publish_ds_bot_issue, with confirmed: true, on the card bound in show_view, can trigger the write. It needs title, the deep-equal view and the one-time report_issue id. The view is deleted before any await, and save({ required: true }) runs before the POST, so a replay or a second click returns bot/stale. Typed replies, cancel and dismiss never reach settleIssueReport. The connector write respects sign-in, per-Bot offFor, connector read-only and host read-only.

2a524f2d only merges dev (which now has #1941) into a2f5cc3a. The PR's own files are unchanged, and the MODULES line keeps both issueReport and manualSkills. Local checks on a2f5cc3a: npm test 3531/3536 passed. The one failure, connectors-gateway "an upstream stream error cannot crash the engine", is in a file this PR doesn't touch and passes 2/2 when run alone (timing flake). On 2a524f2d I re-ran view-reply, connectors, manual-skills, prompt and privacy tests plus build-client --check. build-client --check and npm run lint are clean. The PR body has the Agent: Devin (Cognition) line and a Changelog entry. The design note is in docs/plans/.

None of these block the merge:

  1. The token can go to a host it wasn't issued for. publishDsBotIssue always POSTs to https://api.github.com. The GitHub connector signs in against rt.config.github.api (and .endpoints/.url), which can point somewhere else. When those overrides are set, the Bearer token goes to github.com. Suggest returning undefined (the prefilled-link fallback) unless options.api is the default https://api.github.com and there is no endpoints override.
  2. Bare home paths keep the username. UNIX_HOME/WINDOWS_HOME need a separator after the username, so another user's /Users/alice., (/home/bob) or C:\Users\Jane Doe at the end of a sentence stays as written (I ran the regexes from the PR). The current user's own home is still caught by cleanText. The user reviews the draft before it goes out, so this is low risk. Matching (?=[\\/]|$|[\s.,;:)\]'"])` after the name would close it.
  3. A GitHub 5xx counts as "could not publish". !response.ok returns undefined, so the Bot says "Could not publish… submit on GitHub". A 502/503/504 may still have created the issue. Treating status >= 500 like a thrown error (the "check existing issues first" wording) would avoid duplicate manual filings.
  4. Nit: provider naming. report-ds-bot-issue is now served by the ds-bot-goal provider in goal-skills.js, and the file's header comment was removed. Renaming it (e.g. bundled-skills.js), or at least restoring a header comment, keeps the module honest. #1941 added a third bundled-skill provider (manual-skills.js), so one shared provider is worth considering later.

Overlaps with other open PRs

  • #1941 (ds-bot-manual skill) is already merged into dev, and this head includes it. Small follow-up, here or right after: the manual's references/troubleshooting.md ("When reporting a bug, include…") should send Bots to the report-ds-bot-issue skill, so the two bundled skills give the same advice.
  • #1919, #1915, #1654, #992: each will hit the same one-line MODULES conflict in ds-bot/index.js. It is trivial and shows up whichever lands second.
  • #1939, #1924, #1838, #1818 touch channel.js/parts.js/tools.js but merge cleanly and don't touch the view-reply/show_view paths.

Written by Devin

Keep credentials scoped to the default connector, warn on uncertain writes, and redact bare home directories.
Document the bundled reporting skill and its approval step.

@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: pass (head 7ad93d67, comments only)

Every item from my review at 2a524f2d is fixed:

  1. Token stays on github.com. publishDsBotIssue now returns undefined before loadSecrets() whenever the GitHub connection sets api to anything other than https://api.github.com, or sets endpoints or url. The prefilled form link is used in those cases. The new gh.test cases cover both overrides.
  2. Home paths at the end of a sentence. I checked the new regexes against these inputs: cwd is /Users/alice. → cwd is ~., (/home/bob) → (~), C:\Users\Jane Doe → ~, C:\Users\Jane Doe. → ~., /home/bob, then → ~, then, path=/home/bob → path=~, C:/Users/bob/foo → ~/foo. A 50k-character input ran with no measurable backtracking cost.
  3. 5xx is reported as uncertain. A 5xx response now throws, so settleIssueReport tells the user to check existing issues before submitting manually.
  4. goal-skills.js header comment is back.
  5. The manual's troubleshooting.md now points Bots to report-ds-bot-issue.

Checks on this head: CI shows 7 passed and 0 failed. Locally, the view-reply, connectors, manual-skills, prompt and privacy tests pass 60/60, and build-client --check passes. npm run lint shows only the three existing warnings in unrelated files.

Non-blocking, for a later PR: a Windows home path with no trailing separator, followed by more words, redacts the rest of the sentence. For example, C:\Users\Jane Doe and more text → ~. This hides too much rather than too little, so no username leaks, but the report loses that text. Separately, /Users/ali ce/x → ~ ce/x. macOS short names can't contain spaces, so this is theoretical.

Overlaps: #1941 is already in dev. Compared with dev today, merging this PR adds one new conflict: #1919 will hit the trivial MODULES line in ds-bot/index.js. The other open PRs touching channel.js, parts.js, tools.js or index.js (#1938, #1935, #1934, #1915, #1855, #1838, #1817, #1654) have the same conflicts with or without this PR. #1939, #1924 and #1818 merge cleanly.

@Fei2411
Fei2411 merged commit 2b18f84 into dev Nov 21, 2026
15 checks passed
@Fei2411
Fei2411 deleted the feat/self-report-issue branch November 21, 2026 09:00
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