Title: agent: never add GitHub issue URLs to code comments unless explicitly instructed · Issue #1863 · usethis-python/usethis-python · GitHub
Open Graph Title: agent: never add GitHub issue URLs to code comments unless explicitly instructed · Issue #1863 · usethis-python/usethis-python
X Title: agent: never add GitHub issue URLs to code comments unless explicitly instructed · Issue #1863 · usethis-python/usethis-python
Description: What happened An agent added comments referencing GitHub issue URLs (e.g. # https://github.com/usethis-python/usethis-python/issues/685) to test code. The URLs were hallucinated — they did not correspond to real issues. The reviewer had ...
Open Graph Description: What happened An agent added comments referencing GitHub issue URLs (e.g. # https://github.com/usethis-python/usethis-python/issues/685) to test code. The URLs were hallucinated — they did not corr...
X Description: What happened An agent added comments referencing GitHub issue URLs (e.g. # https://github.com/usethis-python/usethis-python/issues/685) to test code. The URLs were hallucinated — they did not corr...
Opengraph URL: https://github.com/usethis-python/usethis-python/issues/1863
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"agent: never add GitHub issue URLs to code comments unless explicitly instructed","articleBody":"## What happened\n\nAn agent added comments referencing GitHub issue URLs (e.g. `# https://github.com/usethis-python/usethis-python/issues/685`) to test code. The URLs were hallucinated — they did not correspond to real issues. The reviewer had to explicitly flag this and request their removal.\n\n## Root cause\n\nThe agent was explaining context for a bug fix in a test comment. Without a clear prohibition against inventing URLs, it fabricated issue references that looked plausible but pointed to non-existent issues.\n\n## Generalised principle\n\nNever add GitHub issue, PR, or commit URLs to code comments (or any project artefact) unless you have verified that the URL exists and you have been explicitly instructed to include it. Fabricated URLs are worse than no reference at all — they mislead future readers and are impossible to verify without browsing to the URL. If you want to add context in a comment, describe the problem in plain words instead.\n\n## Resolution\n\nThe hallucinated URLs were removed from the test comments in the PR. The tests were updated to describe the problem in plain English without URL cross-references.\n\n## Follow-up\n\nConsider adding a prek hook or check-banned-words rule that detects GitHub URLs in Python comments (as a heuristic for hallucinated references).","author":{"url":"https://github.com/nathanjmcdougall","@type":"Person","name":"nathanjmcdougall"},"datePublished":"2026-04-07T17:51:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1863/usethis-python/issues/1863"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fbd46f21-2649-8ef0-15e8-fe677a501dcc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EE42:30372D:57F912:819C14:6A4E0DF6 |
| html-safe-nonce | 5ef77b26c0426004880192e3f06cd0b8efeb4494b54ea9886e48a9b984077fe8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRTQyOjMwMzcyRDo1N0Y5MTI6ODE5QzE0OjZBNEUwREY2IiwidmlzaXRvcl9pZCI6IjY0OTMwODcwNDY4MzUyNDQ1MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5cffb4ad2d8686043e585456d67435dd67c9a4535d6beb7eb252b0d2a1b922c6 |
| hovercard-subject-tag | issue:4219585166 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/usethis-python/usethis-python/1863/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ecf79003d1fcbaad689916da2794643d93525c5308afbfc3eef2b4ce7e21eec2/usethis-python/usethis-python/issues/1863 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ecf79003d1fcbaad689916da2794643d93525c5308afbfc3eef2b4ce7e21eec2/usethis-python/usethis-python/issues/1863 |
| og:image:alt | What happened An agent added comments referencing GitHub issue URLs (e.g. # https://github.com/usethis-python/usethis-python/issues/685) to test code. The URLs were hallucinated — they did not corr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nathanjmcdougall |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| turbo-cache-control | no-preview |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 51470c353b8a1f52a88d3e3cc2014b17ab8cc1ce |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width