fix(commands): give ask/chat their own fresh reply comment - #5077
Conversation
ask/chat shared AGENT_COMMAND_COMMENT_MARKER with the main PR review panel, so a Q&A answer silently overwrote the review verdict (or a prior answer) and the edited comment stayed at its original timeline position -- never near the question that prompted it. A contributor asking a second question lost the first answer entirely, with no visible reply anywhere near either question. ask/chat now post a fresh comment per invocation via createIssueComment (the same always-fresh pattern already used for approval/closure/ pause/resume notices), linking back to the triggering comment via its own html_url. Every other command's shared, continuously-updated panel is unchanged. Also fixes a separate issue from the same investigation: generateChatQaAnswer retries once on a genuinely empty completion from the local Ollama model (confirmed happening live) before reporting empty_chat_answer; a thrown error is still never retried. Closes #5076
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5077 +/- ##
=======================================
Coverage 94.14% 94.14%
=======================================
Files 467 467
Lines 39598 39606 +8
Branches 14444 14452 +8
=======================================
+ Hits 37278 37286 +8
Misses 1664 1664
Partials 656 656
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-11 13:05:43 UTC
🛑 Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
CI checks failing
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
ask/chatsharedAGENT_COMMAND_COMMENT_MARKERwith the main PR review panel (AGENT_COMMAND_COMMENT_MARKER === PR_PANEL_COMMENT_MARKER), so a Q&A answer silently overwrote the review verdict (or a prior answer), and the edited comment stayed at its ORIGINAL timeline position -- never near the question that prompted it. Confirmed live on feat(miner-governor): closed-loop discovery re-entry trigger (#2338) #5051: achatanswer posted successfully, then a second question overwrote it, with neither ever visible near either asking comment.ask/chatnow post a fresh comment per invocation viacreateIssueComment-- the same always-fresh pattern already used for approval/closure/pause/resume notices (review-evasion.ts,agent-action-executor.ts) -- instead of sharing the panel slot. The reply links back to the specific triggering comment via its ownhtml_url(already present on the webhook payload, no need to construct it). Every other command's shared, continuously-updated panel is unchanged.createIssueComment(src/github/pr-actions.ts) now also returnshtml_url(previously onlyid), so the answer's own permalink is still recorded correctly ingithub_agent_command_answers.response_url.generateChatQaAnswernow retries once when the local Ollama model returns a genuinely empty completion (confirmed happening live on the same PR) before reportingempty_chat_answer-- a thrown error (network/auth) is still never retried, only a resolved-but-empty response.Closes #5076
Test plan
npm run typecheck-- cleanai-chat-qa.test.ts;replyingToUrlrendering + phrasing switch ingithub-commands.test.ts;createIssueComment'shtml_urlextraction ingithub-pr-actions.test.ts; 3 end-to-end integration tests inqueue-5.test.ts(fresh comment per invocation with distinct reply links, the existing PR-panel comment is never PATCHed, dry-run suppresses the live post)npm run test:coverage(full, unsharded) -- 719 files / 14234 tests passed, 0 failures; manually verified every new line/branch inprocessors.ts,commands.ts,pr-actions.ts, andai-chat-qa.ts's retry loop shows non-zero hits on both sides via directlcov.infoinspectionnpm run test:ci(full gate, incl. UI lint/typecheck/test/build, migrations/schema-drift/openapi/docs-drift checks) -- greennpm audit --audit-level=moderate-- 0 vulnerabilities