Repository navigation
[3690 by Claude Opus 5.5] A run whose last message says it is still waiting is reported as finished - #3718
Conversation
…o longer reads as a clean success. The summary-selection call that already picks the summary now also returns whether the run looks unfinished, plus a one-line reason. It is the same single request, with no extra call. When no summarization model is set, the call fails, or there is only one message to choose from, the result comes back unchanged.
All tests pass: the 27 in `test/runSummarySelection.test.ts` and 23 other suites that build completion comments. Typecheck and lint are clean. I didn't run the full test suite or try it on a live run.
How it works
- Model reply (`packages/core/src/agents/runSummarySelection.ts`): the prompt asks whether the last message says the agent is still working, waiting, or about to do more, and to reply with `{"index", "unfinished", "reason"}`. Only `"unfinished": true` counts, so a reply in the old shape reads as finished. The reason is flattened to one line, capped at 300 characters, and given a default when empty. The flag can also come back when no message was picked as the summary.
- Plumbing: the result carries a new `unfinishedReason` field through the two places that convert agent results for the issue and follow-up paths.
What the comments say now
- Issue runs (`packages/core/src/utils/github/logFiles.ts`): the header becomes "AI Processing Ended Unconfirmed" with status "Ended before the agent confirmed completion". A warning says "The run ended before the agent confirmed completion." with the reason, followed by the agent's last update and a list of committed files. If the agent didn't write its own commit message, the fallback commit message uses the same headline.
- PR follow-ups (`src/jobs/prCompletionComment.ts`): the ✅ "Applied the requested follow-up changes" line becomes "⚠️ Committed follow-up changes", with the same warning, "## Last Agent Update" and "## Committed Changes". If nothing was committed, the warning still appears above the analysis.
Decisions for you
- Follow-up requests aren't marked as done. I treat an unfinished follow-up like a partial one: the trigger comments are still marked handled, but they aren't recorded as completed requests for later reviews. This is a judgement call about review behaviour, so flag it if you'd rather keep recording them.
- The shared wording lives in `@propr/shared` (new file `packages/shared/src/unfinishedRun.ts`), not core. Several root tests mock `@propr/core` with a fixed export list, and adding new core exports broke `prCompletionTriggerReleaseFailure.test.ts`.
Tests added with mocked model replies: finished, the old reply shape, unfinished with and without a reason (including when no message is picked as the summary), a capped reason, a failed call, and no configured model. They also check what the follow-up comment and the issue report contain for a finished and an unfinished run.
This only changes GitHub comment text, so I made no visual previews.
|
/ultrafix goal=8 max=3 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 3) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR reuses summary selection to identify unfinished runs and carries that verdict into issue and follow-up comments. It needs a localized correction before merge: the new classifier cannot see completion or waiting statements beyond the existing candidate truncation limit. ✅ Single-call integration — Summary selection and the unfinished verdict use the same model request, preserving existing fallback behavior. ✅ Consistent warning propagation — Both response adapters carry ✅ Compatibility coverage — Added tests cover older reply shapes, missing reasons, failed calls, and finished versus unfinished comment rendering. This review is based on the supplied code; no commands were run. Current checks report no failures, with five pending. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Preserve the final message’s completion evidence
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Distinguish selected summary from last updateBoth unfinished comment paths label the selected summary “Last Agent Update,” although S2: 🟢 Test unfinished follow-up evidenceAdd coverage for an unfinished follow-up with real trigger comments, checking that completed trigger markers remain while accepted-request bindings are omitted. Also cover the no-commit warning branch. These would protect the intentional review-evidence behavior; the supplied partial-run contract supports the approach, so these additional tests are not independently required for merge. ScoreThe implementation is focused and preserves compatibility, but the new classifier loses relevant evidence for longer final messages. No current checks are failing; five remain pending. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit c9af17a
Summary of ChangesI fixed F1: the classification call now sees the agent's complete last message, so a "still running / I'll report back" line past character 1,500 is no longer cut off before the model judges whether the run is unfinished. The fix ( Other places with the same problem: none. This prompt builder is the only thing that feeds the verdict, and Regression tests (
Verification: all 32 tests in This only changes the text sent to the model, so I made no visual previews. Review digestRisk-tiered paths
Diff size: 2 files changed, +44/−1 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…mplete last message, so a "still running / I'll report back" line past character 1,500 is no longer cut off before the model judges whether the run is unfinished. I fixed F1: the classification call now sees the agent's complete last message, so a "still running / I'll report back" line past character 1,500 is no longer cut off before the model judges whether the run is unfinished. **The fix** (`packages/core/src/agents/runSummarySelection.ts`, `buildSummarySelectionPrompt`): the candidates are still cut to 1,500 characters for picking the summary. When the last message is longer than that, the prompt now also quotes it in full in its own `<last-message>` block, with a note to use it for the unfinished verdict. It's still the same single request. Short last messages aren't quoted twice, and earlier candidates stay cut. The block's closing tag is escaped the same way the candidate tags are, so text inside the message can't close it early. **Other places with the same problem:** none. This prompt builder is the only thing that feeds the verdict, and `selectRunSummary` is its only caller. **Regression tests** (`test/runSummarySelection.test.ts`): - A long final message whose waiting statement comes after character 1,500 appears complete in the prompt. - Through `applyRunSummarySelection`, the prompt sent to the model contains that waiting statement, and the reason from the unfinished verdict is recorded. - A short last message produces no `<last-message>` block. - An earlier long candidate stays cut and isn't quoted in full. - A closing tag inside the full message is escaped. **Verification:** all 32 tests in `test/runSummarySelection.test.ts` pass, and core typecheck and lint are clean. As a negative check, I switched the new block off and three of the new tests failed, so they do catch the old behaviour. This only changes the text sent to the model, so I made no visual previews. PR: #3718 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds unfinished-run detection to the existing summary-selection call and carries the result into completion comments. It needs a localized correction for issue runs that produce no changes. ✅ Single-call classification — Summary selection and unfinished detection share one model request, preserving the existing fallback behavior. ✅ Defensive verdict parsing — Only literal ✅ Targeted coverage — Added tests cover long final messages, failed calls, legacy replies, and both completion-comment formats. The supplied current-head checks show 22 passed, no failures, and one pending. This review is based on static analysis; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F2: 🔴 Handle unfinished issues without changes
SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Test completion evidence explicitlyThe unfinished follow-up test passes an empty comment list, so it cannot verify the intentional suppression of completed-request evidence. Add a case with a real trigger comment and accepted-body digest, checking that handling markers remain while completion bindings are absent. This would strengthen coverage of the stated policy; the changed footer calls already appear consistent with it. S4: 🟢 Clarify selected-summary labelingBoth unfinished renderers label the selected summary as the “Last Agent Update,” although selection can deliberately choose an earlier message. Consider retaining a neutral summary label or separately displaying the actual final message. The warning already communicates the unfinished state, so this is an optional clarity improvement. ScoreThe implementation is focused and has useful targeted coverage, but the no-change issue publication path still contradicts the new unfinished classification. A localized correction is needed before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit c082404
Summary of ChangesI fixed F2. When a run is flagged unfinished and commits nothing, the issue comment no longer says the work was complete, and nothing in it points to committed changes that don't exist. What changed
Same defect on the PR follow-up path: the follow-up comment had the same problem when nothing was committed. An unfinished run showed the warning telling readers to review committed changes, then said "No code changes were necessary based on the current state of the branch." It now shows the no-commit warning and says "No code changes were committed." This is in Tests: the new
I ran the new tests against the old code: the two unfinished cases failed and the finished case passed, as expected. With the fix, 215 tests across 19 related suites pass, including Not changed: This only changes GitHub comment text, so I made no visual previews. Review digestRisk-tiered paths
Diff size: 6 files changed, +125/−18 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…thing, the issue comment no longer says the work was complete, and nothing in it points to committed changes that don't exist. I fixed F2. When a run is flagged unfinished and commits nothing, the issue comment no longer says the work was complete, and nothing in it points to committed changes that don't exist. **What changed** - **Issue comment headline** (`src/jobs/issueJobPostProcessingHelpers.ts`, `handleNoCodeChanges`): for a successful run flagged unfinished, the "✅ No code changes needed - the implementation was already complete." line becomes "⚠️ **No code changes were committed, and the agent did not confirm the work was complete.**" Finished runs keep the ✅ headline. The function now tells the report builder that nothing was committed (a new `noCodeChanges` option). - **Issue report** (`packages/core/src/utils/github/logFiles.ts`, `buildUnfinishedSummarySection`): when nothing was committed, the "Committed changes: see the committed diff" line is left out. The warning now ends "No changes were committed, so the requested work may still be outstanding." instead of "Review the committed changes before relying on them." Runs that did commit work look the same as before. - **Shared wording** (`packages/shared/src/unfinishedRun.ts`): the warning helper takes a `{ committed: false }` option, and there is a new `UNFINISHED_NO_CHANGE_HEADLINE` constant. **Same defect on the PR follow-up path:** the follow-up comment had the same problem when nothing was committed. An unfinished run showed the warning telling readers to review committed changes, then said "No code changes were necessary based on the current state of the branch." It now shows the no-commit warning and says "No code changes were committed." This is in `src/jobs/prCompletionComment.ts`. I moved that wording into a small helper to stay under the lint complexity limit. **Tests:** the new `test/unfinishedNoChangeComment.test.ts` checks three things: - the full no-change issue comment that `handleNoCodeChanges` publishes for an unfinished run - the same comment for a finished run, which keeps its success headline - the no-change follow-up comment for an unfinished run I ran the new tests against the old code: the two unfinished cases failed and the finished case passed, as expected. With the fix, 215 tests across 19 related suites pass, including `runSummarySelection` and the no-change completion, PR completion and issue-publication suites. Root, core and shared typecheck cleanly, and lint passes with zero warnings on `src/` and the changed core file. **Not changed:** `handleNoCodeChanges` still applies the done label to an unfinished no-change run. The finding asked only for the headline and the committed-work wording, so I left the label as it is. This only changes GitHub comment text, so I made no visual previews. PR: #3718 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds unfinished-run detection to the existing summary-selection request and carries the verdict into issue and follow-up comments. The changes are cohesive and merge-ready within the stated scope, subject to the remaining validation check. ✅ Single-call detection — Summary selection and unfinished classification share one request, preserving existing fallback behavior. ✅ Accurate no-change wording — Unfinished runs without commits no longer claim that implementation was already complete or direct readers to nonexistent committed changes. ✅ Focused coverage — Added tests cover verdict parsing, long final messages, failure fallbacks, and both comment publication paths. This review is based on static inspection of the supplied code; no commands were run. Current checks report 22 passed, none failed, and one pending. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S5: 🟢 Test unfinished request evidenceAdd a regression test using a real follow-up trigger and accepted-body digest to verify that unfinished runs retain the handled marker while withholding the accepted-request binding. The changed footer calls implement this through the existing partial-run behavior, but the new comment tests use empty trigger lists. This is optional coverage for an apparently correct path. S6: 🟢 Clarify last-update headingsThe unfinished comment sections label the selected summary “Last Agent Update,” although summary selection can deliberately choose an earlier message. Consider “Agent Summary” or preserving the actual final message separately. The warning already communicates the unfinished verdict, so this is a presentation improvement rather than a merge blocker. ScoreThe implementation addresses the stated comment behavior with focused changes and useful regression coverage. No verified merge blockers were found; final validation remains pending. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
AI Implementation Summary
Closes #3690
Branch:
3690/claude-opus-5-5-a-run-whose-last-message--20261118-1725-mmrCommits: ✅ Changes committed (139f642)
AI Processing Completed
Execution Details:
Summary:
A run whose last message says the agent is still working or waiting no longer reads as a clean success. The summary-selection call that already picks the summary now also returns whether the run looks unfinished, plus a one-line reason. It is the same single request, with no extra call. When no summarization model is set, the call fails, or there is only one message to choose from, the result comes back unchanged.
All tests pass: the 27 in
test/runSummarySelection.test.tsand 23 other suites that build completion comments. Typecheck and lint are clean. I didn't run the full test suite or try it on a live run.How it works
packages/core/src/agents/runSummarySelection.ts): the prompt asks whether the last message says the agent is still working, waiting, or about to do more, and to reply with{"index", "unfinished", "reason"}. Only"unfinished": truecounts, so a reply in the old shape reads as finished. The reason is flattened to one line, capped at 300 characters, and given a default when empty. The flag can also come back when no message was picked as the summary.unfinishedReasonfield through the two places that convert agent results for the issue and follow-up paths.What the comments say now
packages/core/src/utils/github/logFiles.ts): the header becomes "AI Processing Ended Unconfirmed" with status "Ended before the agent confirmed completion". A warning says "The run ended before the agent confirmed completion." with the reason, followed by the agent's last update and a list of committed files. If the agent didn't write its own commit message, the fallback commit message uses the same headline.src/jobs/prCompletionComment.ts): the ✅ "Applied the requested follow-up changes" line becomes "Decisions for you
@propr/shared(new filepackages/shared/src/unfinishedRun.ts), not core. Several root tests mock@propr/corewith a fixed export list, and adding new core exports brokeprCompletionTriggerReleaseFailure.test.ts.Tests added with mocked model replies: finished, the old reply shape, unfinished with and without a reason (including when no message is picked as the summary), a capped reason, a failed call, and no configured model. They also check what the follow-up comment and the issue report contain for a finished and an unfinished run.
This only changes GitHub comment text, so I made no visual previews.
Review digest
Risk-tiered paths
packages/core/src/agents/runSummarySelection.ts(+51/−12)packages/core/src/agents/types.ts(+2/−0)packages/core/src/claude/claudeService.ts(+2/−0)packages/core/src/utils/github/logFiles.ts(+18/−0)packages/shared/src/index.ts(+1/−0)packages/shared/src/unfinishedRun.ts(added, +28/−0)src/jobs/issueJob/agent.ts(+1/−0)src/jobs/issueJobPostProcessing.ts(+2/−1)src/jobs/prCompletionComment.ts(+40/−8)src/jobs/prFileUtils.ts(+1/−0)test/runSummarySelection.test.ts(+92/−0)Diff size: 11 files changed, +238/−21 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3690.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!