Skip to content

chore(release): 0.6.4 — Copilot token usage + review-stall fixes#8

Merged
pbean merged 2 commits into
mainfrom
release/0.6.4
Jun 21, 2026
Merged

chore(release): 0.6.4 — Copilot token usage + review-stall fixes#8
pbean merged 2 commits into
mainfrom
release/0.6.4

Conversation

@pbean

@pbean pbean commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Release prep for 0.6.4 (patch). Two Copilot CLI defects from live E2E (1.0.63), fixed per-adapter so other CLIs are unaffected, plus the supporting policy/TUI knobs and doc updates.

Fixed

  • Copilot token usage now records (was always 0). Copilot writes modelMetrics only in the trailing session.shutdown line, ~1s after agentStop — usage was sampled before it landed. read_usage now grace-polls the transcript, driven by a new per-profile usage_grace_s (8s for copilot, 0 elsewhere = read once).
  • Copilot multi-turn reviews no longer stall. agentStop fires per response turn, so a parallel-subagent review ends several turns and tripped the global stop_without_result_nudges default of 1. New per-adapter floor (5 for copilot), overridable per stage via [adapter.review].

Added

  • [adapter] usage_grace_s / stop_without_result_nudges (base + per-stage [adapter.dev|review|triage]), editable in the settings TUI. Unset = inherit the CLI profile's shipped default. Effective value: stage ?? base ?? profile ?? global.

Changed

  • Copilot docs. Pin a capable model — the free GPT-5 mini default silently skips steps in multi-step dev/review — and it's the Copilot CLI binary that's supported, not the VS Code extension.

Notes

  • Layered design mirrors how model/extra_args already work: profile ships the default (copilot works out-of-box), policy.toml overrides it, TUI edits the override.
  • Full suite green (961 passed); trunk check clean. Live Copilot E2E is the reporter's confirmation step (can't run here).
  • Release commit stamps the version everywhere and regenerates TUI screenshots/demo (the settings SVGs pick up the new adapter fields).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added configurable timing parameters for adapter behavior (usage polling grace period and multi-turn stop tolerance).
  • Bug Fixes

    • Fixed Copilot token-usage recording with polling retry mechanism.
    • Resolved multi-turn review stalling with improved per-turn handling.
  • Documentation

    • Clarified Copilot support requires the CLI binary, not the VS Code extension.
    • Updated setup guidance for Copilot initialization and model pinning requirements.
    • Marked Copilot as fully supported and E2E-verified.

pbean and others added 2 commits June 21, 2026 15:08
Two Copilot CLI defects from live E2E (1.0.63), both scoped per-adapter so
other CLIs are unaffected.

- Token usage was always 0/None: Copilot writes modelMetrics only in the
  trailing session.shutdown line, ~1s after agentStop. read_usage now
  grace-polls the transcript instead of reading once.
- Multi-turn reviews stalled: agentStop fires per response turn, so a
  parallel-subagent review ends several turns and tripped the global
  stop_without_result_nudges default of 1.

Adds two layered knobs (CLI profile ships the default; [adapter] /
[adapter.<stage>] policy overrides it; both editable in the settings TUI):
usage_grace_s (8s for copilot) and per-adapter stop_without_result_nudges
(5 for copilot). Effective value = stage ?? base ?? profile ?? global.

Also de-stales the Copilot docs: pin a capable model (the free GPT-5 mini
default silently skips steps in multi-step skills) and clarify it's the
Copilot CLI binary, not the VS Code extension.

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

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Version 0.6.4 adds two new adapter configuration knobs—usage_grace_s (a polling grace period for token-usage tallying) and stop_without_result_nudges (a per-adapter stop/nudge threshold)—through the full stack: profile TOML, policy dataclasses and TOML parsing, GenericTmuxAdapter runtime, and CLI wiring. The Copilot adapter profile is configured with defaults for these knobs and promoted from "pending" to E2E-verified.

Changes

Copilot Adapter Timing Knobs and 0.6.4 Release

Layer / File(s) Summary
CLIProfile and policy dataclass contracts
src/automator/adapters/profile.py, src/automator/policy.py
Adds usage_grace_s and stop_without_result_nudges fields to CLIProfile, StageAdapterPolicy, ResolvedAdapter, and AdapterPolicy.
Policy TOML parsing, validation, and resolution
src/automator/policy.py, src/automator/adapters/profile.py
Introduces _opt_grace/_opt_nudges helpers with non-negative validation; wires them into _stage_adapter, loads(), and _parse_profile; updates resolved() for stage-override-or-base inheritance; adds POLICY_TEMPLATE examples.
Copilot profile defaults and settings schema
src/automator/data/profiles/copilot.toml, src/automator/data/settings/core.toml, src/automator/tui/screens/settings_screen.py
Sets usage_grace_s = 8.0 and stop_without_result_nudges = 5 in the Copilot profile; adds both fields to global and per-stage adapter settings schema; updates TUI numeric input placeholder to prefer spec.placeholder.
GenericTmuxAdapter polling loop and CLI wiring
src/automator/adapters/generic_tmux.py, src/automator/cli.py
__init__ derives _usage_grace_s/_stop_nudges from overrides, profile, and global limits; read_usage polls tally_usage until a deadline; wait_for_completion reads from _stop_nudges; _make_adapters forwards both knobs.
Tests for knob precedence, polling, policy, and profile
tests/test_generic_tmux.py, tests/test_policy.py, tests/test_profile.py, tests/test_tui_settings.py
Adds unit tests for timing/nudge precedence, read_usage polling behavior, policy inheritance and negative-value rejection, profile defaults, and TUI PolicyDoc round-trip for adapter timing knobs.
Copilot documentation and version bumps
CHANGELOG.md, README.md, docs/FEATURES.md, docs/setup-guide.md, pyproject.toml, module.yaml, src/automator/__init__.py, .claude-plugin/marketplace.json, src/automator/data/skills/bmad-auto-setup/assets/module.yaml
Promotes Copilot to E2E-verified in all docs with configuration guidance; bumps version to 0.6.4 across all manifest and package files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • bmad-code-org/bmad-auto#7: Introduced the Copilot session.shutdown usage parser and profile/hook wiring that the new usage_grace_s polling in GenericTmuxAdapter.read_usage directly depends on.

Poem

🐇 A grace period born, a nudge count set right,
Copilot now tallies its tokens with might.
No more stalling mid-turn, no more usage missed cold,
The polling loops gently till metrics unfold.
Verified, E2E, from pending to done—
Version 0.6.4 hops out in the sun! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately captures the main change: a 0.6.4 release addressing Copilot token usage and review-stall issues, which is reflected throughout the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/0.6.4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@augmentcode

augmentcode Bot commented Jun 21, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Prepares the 0.6.4 patch release and fixes two Copilot CLI E2E issues (token usage reporting and multi-turn review stalls).

Changes:

  • Bumped version references to 0.6.4 across project metadata and module manifests.
  • Added adapter-level and per-stage knobs: usage_grace_s and stop_without_result_nudges (policy + TUI settings).
  • Updated GenericTmuxAdapter to (a) use an effective nudge limit per adapter and (b) grace-poll transcripts for late-arriving usage metrics.
  • Extended the Copilot profile defaults (usage_grace_s=8, stop_without_result_nudges=5) and updated docs to clarify Copilot CLI requirements/model pinning.
  • Added/updated tests covering precedence and the new usage polling behavior.

Technical Notes: Effective adapter values resolve as stage override → base adapter override → CLI profile default → global limits fallback (where applicable).

🤖 Was this summary useful? React with 👍 or 👎

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

if usage_parser not in USAGE_PARSERS:
raise fail(f"usage_parser must be one of {sorted(USAGE_PARSERS)}: got {usage_parser!r}")

usage_grace_s = float(doc.get("usage_grace_s", 0.0))

@augmentcode augmentcode Bot Jun 21, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

usage_grace_s = float(...) and the int(...) cast for stop_without_result_nudges can raise TypeError/ValueError for non-numeric TOML values, which would bypass the intended ProfileError path and surface as an unhandled exception. Consider validating types / catching conversion failures so misconfigurations consistently produce a user-friendly profile parse error.

Other locations where this applies: src/automator/adapters/profile.py:126, src/automator/policy.py:288, src/automator/policy.py:298.

Severity: medium

Other Locations
  • src/automator/adapters/profile.py:126
  • src/automator/policy.py:288
  • src/automator/policy.py:298

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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

🧹 Nitpick comments (1)
tests/test_tui_settings.py (1)

111-114: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add the clear-to-inherit assertion for the stage nudge knob too.

This test validates clear semantics for usage_grace_s, but not for adapter.review.stop_without_result_nudges after setting it on Line 105. Add a symmetric clear + assert-None check to lock in delete-key behavior for both new knobs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_tui_settings.py` around lines 111 - 114, The test validates clear
semantics for usage_grace_s but lacks a symmetric test for
adapter.review.stop_without_result_nudges that was set earlier on line 105. Add
a matching clear-to-inherit assertion block after the usage_grace_s test by
setting adapter.review.stop_without_result_nudges to None via doc.set(), then
asserting that
policy_mod.loads(doc.dumps()).adapter.review.stop_without_result_nudges is None
to ensure consistent delete-key behavior for both configuration knobs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/test_tui_settings.py`:
- Around line 111-114: The test validates clear semantics for usage_grace_s but
lacks a symmetric test for adapter.review.stop_without_result_nudges that was
set earlier on line 105. Add a matching clear-to-inherit assertion block after
the usage_grace_s test by setting adapter.review.stop_without_result_nudges to
None via doc.set(), then asserting that
policy_mod.loads(doc.dumps()).adapter.review.stop_without_result_nudges is None
to ensure consistent delete-key behavior for both configuration knobs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 722789ef-da75-4563-a7b6-0fe7fa1b854c

📥 Commits

Reviewing files that changed from the base of the PR and between 336bb23 and 03ba939.

⛔ Files ignored due to path filters (11)
  • docs/images/dashboard.png is excluded by !**/*.png
  • docs/images/dashboard.svg is excluded by !**/*.svg
  • docs/images/demo.gif is excluded by !**/*.gif
  • docs/images/settings-scm.png is excluded by !**/*.png
  • docs/images/settings-scm.svg is excluded by !**/*.svg
  • docs/images/settings.svg is excluded by !**/*.svg
  • docs/images/start-run-modal.png is excluded by !**/*.png
  • docs/images/start-run-modal.svg is excluded by !**/*.svg
  • docs/images/sweep-decision.png is excluded by !**/*.png
  • docs/images/sweep-decision.svg is excluded by !**/*.svg
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • .claude-plugin/marketplace.json
  • CHANGELOG.md
  • README.md
  • docs/FEATURES.md
  • docs/setup-guide.md
  • module.yaml
  • pyproject.toml
  • src/automator/__init__.py
  • src/automator/adapters/generic_tmux.py
  • src/automator/adapters/profile.py
  • src/automator/cli.py
  • src/automator/data/profiles/copilot.toml
  • src/automator/data/settings/core.toml
  • src/automator/data/skills/bmad-auto-setup/assets/module.yaml
  • src/automator/policy.py
  • src/automator/tui/screens/settings_screen.py
  • tests/test_generic_tmux.py
  • tests/test_policy.py
  • tests/test_profile.py
  • tests/test_tui_settings.py

@pbean pbean merged commit d90628c into main Jun 21, 2026
7 checks passed
@pbean pbean deleted the release/0.6.4 branch June 21, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant