Skip to content

LINBEE-30174 | fix: backfill a missed grade at SessionEnd (v1.1.1) - #4

Merged
nivSwisa1 merged 2 commits into
mainfrom
LINBEE-30174-backfill-decision
Oct 8, 2026
Merged

nivSwisa1 merged 2 commits into
mainfrom
LINBEE-30174-backfill-decision

Conversation

@nivSwisa1

@nivSwisa1 nivSwisa1 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Interrupted turns never fire Stop, so the grade was lost while SessionEnd still sent tokens (seen on a customer org); SessionEnd now backfills unsent decisions (tagged backfill=session_end) and vseen is recorded only after the repo resolves. Tests: new backfill_test 4/4 (old reporter fails 2), all existing suites green.

🤖 Generated with Claude Code

✨ PR Description

Purpose: Update the agentic-advisor plugin to backfill missed grade decisions during the SessionEnd event.

Main changes:

  • Refactored grade reporting into report_decisions to allow execution during both Stop and SessionEnd
  • Added backfill: session_end tag to DECISION events triggered during session termination
  • Updated plugin version to 1.1.1 across marketplace and plugin configuration files

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

…repo yet

An interrupted turn never fires Stop, so the grade was lost while SessionEnd still
sent its tokens event (seen live on a customer org). SessionEnd now sends any unsent
decision, tagged backfill=session_end. vseen is recorded only once the repo resolves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 17:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Multi-repository backfills can report incorrect repository identity and grading-token metadata.

1 open finding
What changed in this PR

Adds SessionEnd recovery for effort decisions missed by interrupted turns and updates the plugin release metadata.

Changes:

  • Backfills unsent decisions during SessionEnd.
  • Delays vseen recording until repository resolution.
  • Bumps the plugin version to 1.1.1.
File Description
plugins/​agentic-advisor/​README.md Documents SessionEnd backfills.
plugins/​agentic-advisor/​hooks/​agentic-advisor-report.sh Implements decision backfilling.
plugins/​agentic-advisor/​.claude-plugin/​plugin.json Bumps plugin version.
.claude-plugin/​marketplace.json Updates marketplace versions.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread plugins/agentic-advisor/hooks/agentic-advisor-report.sh

@gitstream-cm gitstream-cm Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✨ PR Review

The hook changes are a focused, well-reasoned fix for the "grade lost on interrupted turn" problem: moving the vseen write to after repo_url resolution and refactoring the decision-reporting loop into a reusable function that also runs on SessionEnd (tagged backfill=session_end) looks correct and consistent with the surrounding dedup logic. The main concern is that the ticket this PR is meant to close specifies a different/additional approach that isn't reflected in the diff.

1 issues detected:

🎯 Scope - The implementation diverges from the ticket's specified technical direction and leaves one of the two required findings (phase-2 correction dedup) unaddressed.

Details: The linked ticket explicitly directs reporting the decision on the first PreToolUse after the verdict (keeping Stop as fallback) to fix the "grade lost mid-response" issue, and separately requires adding a stable session key + per-session sequence number so consumers can dedupe preliminary vs. corrected grades (finding #2). This PR instead implements a SessionEnd-based backfill for the missed-grade case and does not address the session-key/sequence-number requirement for the double-counting issue at all.

File: plugins/agentic-advisor/hooks/agentic-advisor-report.sh (320-366)

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

@orca-security-us orca-security-us Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed OSS Licenses high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 17:10
@nivSwisa1

Copy link
Copy Markdown
Contributor Author

Re gitStream's scope note (vs LINBEE-30174's suggested first-PreToolUse approach): deliberate. Backfilling unsent decisions at SessionEnd recovers the lost grade with no extra hook on every tool call, and it was verified to reproduce and fix the exact customer case (tokens arrived, decision didn't). The ticket's second part — a session key/sequence to dedupe preliminary vs phase-2-corrected grades — is not addressed here and stays open on LINBEE-30174.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approved

The backfill path preserves existing deduplication while addressing interrupted turns without introducing unresolved issues.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@MishaKav MishaKav left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great job! 🎉

@nivSwisa1
nivSwisa1 merged commit c141d70 into main Oct 8, 2026
12 checks passed
@nivSwisa1
nivSwisa1 deleted the LINBEE-30174-backfill-decision branch October 8, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants