Skip to content

LINBEE-29986 | feat: add agentic-advisor plugin (v1.0.0) - #1

Merged
nivSwisa1 merged 8 commits into
mainfrom
LINBEE-29986-agentic-advisor
Oct 6, 2026
Merged

nivSwisa1 merged 8 commits into
mainfrom
LINBEE-29986-agentic-advisor

Conversation

@nivSwisa1

@nivSwisa1 nivSwisa1 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Adds agentic-advisor to the linearb-ai marketplace: before writing code it grades how fragile the target is from LinearB health signals + local git history and holds the agent to a LOW/MEDIUM/HIGH effort level. Telemetry to the user's own LinearB org is on by default when LINEARB_API_TOKEN is set and turned off with LINEARB_TELEMETRY=0; LINEARB_API_URL supports on-prem/regional hosts.

🤖 Generated with Claude Code

✨ PR Description

Purpose: Implement the agentic-advisor plugin to size AI coding effort based on LinearB health signals and local git history.

Main changes:

  • Added a skill to grade repo fragility and mandate LOW/MEDIUM/HIGH coding postures
  • Implemented auto-trigger hooks for prompt analysis and first-edit blocking via agentic-advisor-trigger.sh
  • Added agentic-advisor-report.sh for telemetry reporting of effort decisions and token usage

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

Public release of LinearB's effort-grading skill: before writing code it reads
LinearB repo health (rework, incidents, unreviewed merges) + local git history
and holds the agent to a LOW/MEDIUM/HIGH effort level.

- install: /plugin install agentic-advisor@linearb-ai
- LINEARB_API_URL overrides the API host for on-prem/regional deployments
- telemetry is opt-in (LINEARB_API_TOKEN), reported as
  agentic_advisor.effort_decision only to the user's own org

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

@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 Secrets high 0   medium 0   low 0   info 0 View in Orca

gitstream-cm[bot]
gitstream-cm Bot previously requested changes Oct 6, 2026

@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.

This AI-generated PR is too complex. Please split into smaller PRs (<500 lines, <15 files).

@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

Solid, well-documented plugin addition with thoughtful fire-and-forget telemetry design. Found a security concern around how the API token is passed to curl (exposing it via process listings) and a potential false-positive bug in the dedup logic that uses unanchored substring matching against state files.

3 issues detected:

🔒 Security - Secret value is embedded in the curl command line, exposing it via process listings on shared systems. 🛠️

Details: The post() function passes the token directly as a literal value inside the curl command line (-H "x-api-key: $token"). On most systems this means the token is visible to any other local user via ps aux//proc/<pid>/cmdline for the lifetime of the subprocess, which contradicts the script's own stated design goal ("Secret-safe: the token is only ever passed as an env-var reference to curl").

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

🛠️ A suggested code correction is included in the review comments.

🐞 Bug - Substring matching on dedup keys can cause false positives and silently drop legitimate telemetry events. 🛠️

Details: Dedup checks (grep -q "$key" "$state") use the raw 16-char sha1-derived key as a grep pattern without anchoring (-x/^$) or using -F. Since the key is appended one-per-line, a key that happens to be a substring of another previously-stored key (or vice versa) could cause a false match, silently suppressing a legitimate new event from being reported.

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

🛠️ A suggested code correction is included in the review comments.

🔒 Security - Predictable temp file/directory paths without permission hardening can be exploited via symlink attacks on shared systems.

Details: Marker/state files are created at predictable paths under the shared ${TMPDIR:-/tmp}/agentic-advisor directory using plain mkdir -p/touch, without exclusive creation or permission hardening. On a multi-user system this is susceptible to a symlink/race attack where another local user pre-creates these paths pointing elsewhere, causing subsequent writes (mv -f, touch, append) to follow the symlink.

File: plugins/agentic-advisor/hooks/agentic-advisor-report.sh (87-90)

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

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

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.

Copilot review overview

🟡 Changes recommended

Telemetry consent, multi-repository handling, secret exposure, and grading consistency issues remain unresolved.

Review effort: Balanced
Findings: 3 High severity · 6 Medium severity · 1 Low severity

Open (10)
What changed in this PR

Adds the first LinearB marketplace plugin, providing repository health-based coding effort guidance and optional telemetry.

Changes:

  • Registers and documents agentic-advisor v1.0.0.
  • Adds LinearB health and local-history grading guidance.
  • Adds automatic trigger and telemetry hooks.
File Description
README.md Lists the new plugin.
.claude-plugin/​marketplace.json Registers the marketplace package.
plugins/​agentic-advisor/​.claude-plugin/​plugin.json Defines plugin metadata.
plugins/​agentic-advisor/​README.md Documents installation, behavior, and telemetry.
plugins/​agentic-advisor/​skills/​agentic-advisor/​SKILL.md Defines signal collection and effort grading.
plugins/​agentic-advisor/​hooks/​hooks.json Registers lifecycle hooks.
plugins/​agentic-advisor/​hooks/​agentic-advisor-trigger.sh Triggers grading before code edits.
plugins/​agentic-advisor/​hooks/​agentic-advisor-report.sh Reports decisions and token metrics.

💡 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 Outdated
Comment thread plugins/agentic-advisor/skills/agentic-advisor/SKILL.md Outdated
Comment thread plugins/agentic-advisor/skills/agentic-advisor/SKILL.md Outdated
Comment thread plugins/agentic-advisor/hooks/agentic-advisor-report.sh
Comment thread plugins/agentic-advisor/hooks/agentic-advisor-report.sh
Comment thread plugins/agentic-advisor/hooks/agentic-advisor-report.sh Outdated
Comment thread plugins/agentic-advisor/hooks/agentic-advisor-trigger.sh
Comment thread plugins/agentic-advisor/skills/agentic-advisor/SKILL.md Outdated
Comment thread plugins/agentic-advisor/skills/agentic-advisor/SKILL.md Outdated
Comment thread plugins/agentic-advisor/README.md Outdated
… accuracy

- telemetry stays on by default; LINEARB_TELEMETRY=0 turns reporting off,
  and the README now says so plainly
- reporter and skill pass the API token to curl on stdin (-H @-), so it no
  longer appears in curl's argv / process listings
- skill skips the familiarity signal when there is no git identity, and the
  phase-2 combine rule keeps all three axes
- README: current phase-2 signal and 24h repo-health cache

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

@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 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

@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

Well-documented, defensive shell hooks for the new agentic-advisor plugin. The previously flagged token-exposure issue appears fixed (token is now passed to curl via stdin, not argv). The unanchored grep dedup and the predictable-path marker/state files without hardening (previously raised) remain present but unchanged, so they are not re-reported. One new concern found around session-id fallback causing shared state across unrelated sessions.

1 issues detected:

🐞 Bug - Falling back to a fixed "default" filename when session_id is missing can cause state to be shared/corrupted across unrelated concurrent sessions. 🛠️

Details: When session_id is empty, the dedup/state file falls back to a fixed name (${marker_dir}/default.reported, and similarly default.vseen). If multiple hook invocations across genuinely different sessions all lack a session_id (e.g. older Claude Code versions, or non-interactive invocations), they would share the same state file. This could cause one session's reported decisions to suppress another session's events as duplicates, or cause the baseline/graded bucket determination and verdict-count tracking to behave inconsistently across unrelated sessions.

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

🛠️ A suggested code correction is included in the review comments.

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

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

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.

- README: task/file checks are never cached and run whenever the skill runs
- SKILL: the combine-rule note now says 'the axes', not 'the two axes'

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

@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

Overall the hooks are carefully engineered with explicit fail-open/fail-safe behavior and detailed documentation. The previously flagged token-exposure issue appears fixed (token is now passed to curl via stdin instead of as a command-line argument). The dedup-pattern-matching and predictable-marker-path issues from the previous review still exist unchanged. One new maintainability concern is the unbounded growth of per-session marker/state files with no cleanup mechanism.

1 issues detected:

🧹 Maintainability - No cleanup/expiry mechanism exists for the per-session marker and state files, causing them to accumulate indefinitely.

Details: The marker directory accumulates .reported, .vseen, and (in the trigger script) .done/.held files per session indefinitely, with no cleanup, expiry, or rotation logic anywhere in the hook. Over many sessions on a shared machine or CI runner, ${TMPDIR:-/tmp}/agentic-advisor will grow without bound, consuming disk/inode resources and never being reclaimed.

File: plugins/agentic-advisor/hooks/agentic-advisor-report.sh (92-95)

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

nivSwisa1 and others added 2 commits October 6, 2026 15:18
… contact email

- skill: the cache write uses a per-process temp file ($f.$$.tmp), so two
  concurrent sessions grading the same repo can't clobber each other's temp file
- reporter: holdout first_edit ignores docs/text files (same list as the trigger),
  so a docs-only session is no baseline beacon and coding_tokens start at the first code edit
- contact email: support@linearb.io (LinearB's public support address)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ontact

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

Copilot review overview

🔵 Needs a closer look

Telemetry requests use an invalid timestamp format and multi-repository sessions produce incorrect attribution and token measurements.

Review effort: Balanced
Findings: None

Resolved since last review (4)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Use ISO-8601 timestamps for custom metrics payloads

plugins/​agentic-advisor/​hooks/​agentic-advisor-report.sh:161

The External Custom Metrics API requires timestamp to be an ISO-8601 string, but this produces a numeric Unix-millisecond value and every payload inserts it with --argjson. Those requests will fail validation, while the detached curl suppresses the error, so the advertised telemetry can silently report nothing. Generate a UTC ISO-8601 timestamp and pass it with --arg ts at all three payload builders.

This issue also appears in the following locations of the same file:

  • line 191
  • line 201
Low severity Use unique temporary files for concurrent writes

plugins/​agentic-advisor/​skills/​agentic-advisor/​SKILL.md:40

Using the shared $f.tmp name does not make concurrent writers safe: two sessions can truncate/write or move the same temporary file, allowing one writer to alter the file another has already renamed. Use a unique temporary file in the destination directory (for example $f.$$ or mktemp "${f}.XXXXXX") before the atomic mv.

This issue also appears on line 112 of the same file.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 12:22
@gitstream-cm

gitstream-cm Bot commented Oct 6, 2026

Copy link
Copy Markdown

🚦 Automatic AI Review skipped

This pull request has used all 3 of its automatic AI Reviews.

✨ Comment /gs review to run one now.
No arguments needed. It uses the same settings as your automatic reviews: gitStream Settings in Managed Mode, your CM files in Self-Managed.

@nivSwisa1

Copy link
Copy Markdown
Contributor Author

Re: Copilot's "Use ISO-8601 timestamps for custom metrics payloads" (agentic-advisor-report.sh:161): not an issue — no change needed.

The custom-metrics endpoint accepts both formats: PostCustomMetricModel declares timestamp: Union[str, int] and converts either to UTC in its validator, and the model's own example titled "Example with timestamp that is EPOCH" uses "timestamp": 1706622966150 — epoch milliseconds, exactly what the reporter sends (date +%s × 1000). This reporter has been sending epoch-ms since July and its events land in reported_metrics with correct timestamps, so requests are not failing validation.

@MishaKav

MishaKav commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

/gs review

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.

Copilot review overview

🟡 Changes recommended

Edit gating, failure handling, cache security, and telemetry timing can produce bypassed or inaccurate grading.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Previously missed (4)

In code that hasn't changed since last review

Medium severity Stop hook loses verdicts when responses continue

plugins/​agentic-advisor/​hooks/​agentic-advisor-report.sh:8

Stop runs when the agent finishes the response, not when this intermediate verdict first appears. If the response continues through exploration and edits, process termination before completion still loses the decision, so this does not provide the claimed early, crash-resistant reporting. Emit from a lifecycle point after the verdict but before coding (for example, the first relevant PreToolUse) and retain Stop as a fallback.

Medium severity Preliminary and corrected verdicts are both counted

plugins/​agentic-advisor/​hooks/​agentic-advisor-report.sh:315

This loop reports every verdict in the transcript, so the documented phase-2 correction emits both the preliminary grade and the corrected grade. Since consumers are told to count phase=decision rows, one task is double-counted and the stale grade remains in aggregates. Report only the latest decision per repo, or include a stable session/sequence identifier so consumers can select the corrected decision.

Medium severity New directories bypass grading on the first write

plugins/​agentic-advisor/​hooks/​agentic-advisor-trigger.sh:133

A Write into a newly created directory bypasses the hold because git -C "$dir" fails when the target directory does not exist. This is common when adding a new component/module, and it lets the first source write proceed without grading. Walk up to the nearest existing parent for both the repository check and marker key.

Medium severity HTTP failures are misclassified as dormant repositories

plugins/​agentic-advisor/​skills/​agentic-advisor/​SKILL.md:79

curl treats HTTP 4xx/5xx responses as successful here, and the pipeline does not use pipefail. A failed measurements request can therefore collapse to no selected row and be classified by line 90 as a dormant/LOW repository instead of the required unavailable/MEDIUM fallback. Make HTTP failures produce a failing pipeline before interpreting an empty successful response as dormancy.

Comment thread plugins/agentic-advisor/skills/agentic-advisor/SKILL.md Outdated

@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 two new hook scripts and plugin manifest are well-documented and mostly defensive against failure modes already called out in prior review rounds (token now goes to curl via stdin). One new concern stands out: the JSON payload itself is still passed as a literal curl argument, which can leak contributor PII through the process table on shared machines.

3 issues detected:

🔒 Security - Sensitive user/repo data is passed as a visible process argument instead of via stdin/file. 🛠️

Details: The post() function passes the full JSON payload via -d "$1" as a literal curl command-line argument. While the token itself is now protected (passed on stdin via -H @-), the payload contains contributor_email, repo_url, branch, ticket, and session_name — all visible to any local user via ps aux or /proc/<pid>/cmdline for the duration of the backgrounded curl process.

File: plugins/agentic-advisor/hooks/agentic-advisor-report.sh (168-171)

🛠️ A suggested code correction is included in the review comments.

🐞 Bug - The `||` fallback pattern shares a single stdin read between two commands, so a failing-but-present primary tool silently starves the fallback of input. 🛠️

Details: sha1() { { shasum 2>/dev/null || sha1sum 2>/dev/null; } | cut -c1-16; } pipes stdin into whichever tool runs first. If shasum exists on PATH but fails for a reason other than "not found" (e.g. unsupported flag, permission issue), the || triggers sha1sum as a fallback, but the piped stdin has already been consumed by the failed shasum invocation, so sha1sum hashes empty input — silently producing a wrong/empty key used for dedup and bucket assignment.

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

🛠️ A suggested code correction is included in the review comments.

🐞 Bug - The pipeline does not exclude blank model values before selecting the most recent entry. 🛠️

Details: model is derived by taking the .message.model of the last matching assistant entry in the transcript and filtering out <synthetic>, but it does not filter out blank/empty values. If the most recent assistant turn lacks a model field (e.g. a tool-only turn), tail -1 can return an empty string even though earlier turns carried a valid model, silently dropping the model tag from the reported event.

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

🛠️ A suggested code correction is included in the review comments.

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

Comment thread plugins/agentic-advisor/hooks/agentic-advisor-report.sh Outdated
Comment thread plugins/agentic-advisor/hooks/agentic-advisor-report.sh Outdated
Comment thread plugins/agentic-advisor/hooks/agentic-advisor-report.sh Outdated
…, payload off argv

- skill: curl -f + pipefail; a failed call (HTTP 4xx/5xx, timeout) is 'unavailable',
  never 'dormant'/'not found'; 401/403 = invalid/expired token -> MEDIUM + tell the user
- trigger: a Write into a not-yet-existing folder walks up to the nearest existing
  parent, so the first file of a new module is still held for grading
- cache + hook state moved from shared /tmp to ~/.cache/<plugin> (umask 077); the skill
  only trusts cache files you own; reporter skips if it has no private state dir
- reporter: payload sent via a private temp file (--data-binary @file), so neither the
  token nor contributor data appears in curl's argv
- sha1 helper picks shasum/sha1sum up front; model tag skips blank values

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

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.

Copilot review overview

🟡 Changes recommended

Native editing tools can bypass grading, telemetry may expose remote credentials, and documented token reporting has an undeclared Python dependency.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (1)
Previously missed (4)

In code that hasn't changed since last review

Medium severity Token accounting fails without Python

plugins/​agentic-advisor/​hooks/​agentic-advisor-report.sh:194

Token accounting silently requires python3, although the documented requirements only list jq, git, and curl. Without Python, parsed remains {}: decision events omit grading_tokens, graded SessionEnd exits without a tokens event, and baseline sessions emit nothing. Add a non-Python fallback or make Python an explicit requirement.

Medium severity Jira keys misclassify questions as code tasks

plugins/​agentic-advisor/​hooks/​agentic-advisor-trigger.sh:96

Any Jira-style key unconditionally marks the prompt as a code task. A question such as “summarize ABC-123” therefore triggers the mandatory skill/API sweep, despite the plugin README stating that questions are skipped. Require code-writing intent (or explicitly exclude question-only prompts) before taking the ticket branch.

Medium severity Native edit tools bypass the editing gate

plugins/​agentic-advisor/​hooks/​hooks.json:15

The backstop only intercepts Edit and Write. Native NotebookEdit/MultiEdit calls can therefore modify source before any effort grade, and the trigger/report parsers also ignore those tool names. Extend the matcher and path parsing (notebook_path for notebooks) so every native editing tool follows the same gate.

Medium severity Bug PR threshold cannot trigger without bug metrics

plugins/​agentic-advisor/​skills/​agentic-advisor/​SKILL.md:116

These thresholds include bug-PR counts, but signal gathering only requests rework and unreviewed-merge metrics plus incidents; no step obtains bug PRs. Consequently the 5+ bug PRs HIGH condition can never fire and may under-grade the repository. Either gather this signal or remove it from the grading criteria.

Comment thread plugins/agentic-advisor/hooks/agentic-advisor-report.sh
The example gave '9 fix/revert commits' as the reason for HIGH, contradicting
the rule that fix/revert wording is a weak hint that never raises effort alone.

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

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.

Copilot review overview

🟡 Changes recommended

Credential-bearing repository URLs can leak secrets through telemetry and process arguments, and prompt detection fails on macOS.

Review effort: Balanced
Findings: 2 High severity

Open (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Use portable word-boundary matching across grep implementations

plugins/​agentic-advisor/​hooks/​agentic-advisor-trigger.sh:97

This \b expression is GNU-specific; the default BSD grep -E on macOS does not treat it as a word boundary, so the keyword gate never auto-fires there. Use explicit alphanumeric boundaries so prompt-time grading works on both supported platforms.

Comment thread plugins/agentic-advisor/skills/agentic-advisor/SKILL.md
…d; note optional python3

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

Copy link
Copy Markdown
Contributor Author

Re: Copilot's "Previously missed" findings — fixed in 770dba5: unused 5+ bug PRs threshold removed; README now notes python3 is optional (grades still report, token counts/grading time omitted). Not changed: \b on macOS (verified BSD grep 2.6.0 honors it), Jira key triggers on questions (by design — a stray nudge is cheap), NotebookEdit not gated (rare; backlog).

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.

Copilot review overview

🔵 Needs a closer look

Telemetry timestamps violate the API contract, and several trigger and reporting paths can lose intended signals.

Review effort: Balanced
Findings: None

Resolved since last review (2)
Previously missed (4)

In code that hasn't changed since last review

Medium severity Persist verdict count only after successful verdict reporting

plugins/​agentic-advisor/​hooks/​agentic-advisor-report.sh:113

This records the verdict count before confirming that a repository URL and reportable verdict are available. For example, a session launched from a parent directory can print a verdict before its first edit; this Stop writes vseen, then exits because repo_url is empty. After the later edit makes repository resolution possible, the unchanged count triggers the fast exit and the decision is never reported. Persist vseen only after the Stop path has successfully processed the current verdicts.

Medium severity Emit ISO-8601 timestamp instead of epoch milliseconds

plugins/​agentic-advisor/​hooks/​agentic-advisor-report.sh:168

The reported-metrics API requires timestamp to be an ISO-8601 string, but this produces a JSON number in epoch milliseconds. Every telemetry payload can therefore be rejected with a validation error, which is hidden by the detached curl. Generate a JSON-encoded ISO timestamp so the existing --argjson ts bindings emit a string.

Medium severity Recognize all supported code-writing verbs in task matcher

plugins/​agentic-advisor/​hooks/​agentic-advisor-trigger.sh:97

This matcher omits common code-writing verbs explicitly advertised by the skill, such as “add”, “create”, “write”, and “modify”. For prompts like “add a component”, no start-of-task nudge is emitted; the backstop runs only at the first edit, after the agent may already have read and explored files, contrary to the mandatory-first-step behavior. Include those supported task verbs in the prompt gate.

Medium severity Handle zero matching commits without treating probe as failed

plugins/​agentic-advisor/​skills/​agentic-advisor/​SKILL.md:173

grep -c prints 0 but exits with status 1 when this developer has no matching commits—the exact unfamiliar-code case this probe is meant to detect. The Bash tool will report the probe as failed (and pipefail preserves that failure), so the agent may discard the zero-commit signal instead of raising change-area effort. Count with awk, which exits successfully for zero matches while still letting a git log failure propagate.

@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 315426f into main Oct 6, 2026
10 of 11 checks passed
@nivSwisa1
nivSwisa1 deleted the LINBEE-29986-agentic-advisor branch October 6, 2026 13:18
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