Skip to content

[auto] sync agent CLI harnesses with upstream docs#489

Open
NiveditJain wants to merge 1 commit into
mainfrom
auto/sync-cli-harnesses-20260712T033027Z
Open

[auto] sync agent CLI harnesses with upstream docs#489
NiveditJain wants to merge 1 commit into
mainfrom
auto/sync-cli-harnesses-20260712T033027Z

Conversation

@NiveditJain

@NiveditJain NiveditJain commented Jul 12, 2026

Copy link
Copy Markdown
Member

Automated ultracode sync run: one subagent per integrated agent CLI fetched the CLI's current upstream hook docs and diffed them against this repo's *HOOK_EVENT_TYPES arrays, *_TOOL_MAP / *_TOOL_INPUT_MAP tables, per-CLI policy-evaluator.ts branches, integrations.ts writer literals, and committed dogfood fixtures. Every claimed drift was re-checked by a second, skeptical verifier agent before being reported.

Outcome: five CLIs are up to date; two show tool-map (scope-2) drift. Both drift items are judgement-heavy (which canonical name a removed/renamed tool maps to is a human decision, and one relies on a deprecated upstream package), so per the run contract they are surfaced below as reviewer-checklist items rather than auto-edited. There are no hook-event-name (scope-1) appends and no settings-file-shape (scope-3) fixes, so this PR makes no code changes — only the reviewer checklist and a CHANGELOG.md entry.

Summary

CLI scope-1 (events) scope-2 (tools/payload) scope-3 (settings shape) status
Claude Code up to date n/a (canonical) up to date up to date
OpenAI Codex up to date up to date up to date up to date
GitHub Copilot up to date up to date up to date up to date
Cursor Agent up to date up to date up to date up to date
OpenCode up to date up to date up to date up to date
Pi up to date (see note) drift unobserved drift
Gemini CLI up to date drift up to date drift

Per-CLI drift

Pi (@mariozechner/pi-coding-agent)

  • scope-1 — no drift. The audited upstream (badlogic/pi-mono extensions.md) documents 33 pi.on(...) events; the repo's PI_HOOK_EVENT_TYPES intentionally subscribes to a curated 7-event parity set (session_start, session_shutdown, input, tool_call, user_bash, tool_result, agent_end), the same design as Cursor. The 26 extra events (turn_start, turn_end, agent_settled, model_select, thinking_level_select, before_provider_request, context, session_before_fork, …) are Pi-specific with no canonical Claude lifecycle equivalent and are deliberately unsubscribed — not drift. No append.
  • scope-2 — drift (deferred to checklist). PI_TOOL_MAP maps glob → Glob, but the audited upstream lists core tools as read, bash, edit, write, grep, find, ls — there is no glob (Pi documents find for name/pattern matching), and find/ls are unmapped. read/write/edit/bash/grep all still match.
  • scope-3 — unobserved. The .pi/settings.json packages-array shape is not described by the accessible docs; no change detected.

Gemini CLI

  • scope-1 — no drift. https://geminicli.com/docs/hooks/ still enumerates exactly the 11 GEMINI_HOOK_EVENT_TYPES (confirmed verbatim by the verifier).
  • scope-2 — drift (deferred to checklist). save_memory is no longer present in the upstream tools reference (https://geminicli.com/docs/reference/tools/); the Memory category now lists activate_skill and get_internal_docs. GEMINI_TOOL_MAP still maps save_memory → Memory, so that entry is now stale. Every other mapped tool id was confirmed present and unchanged (notably run_shell_command was not renamed to shell, and grep_search was not renamed to grep).
  • scope-3 — no drift. .gemini/settings.json shape confirmed: per-event matcher field present, timeout in milliseconds (default 60000) — matches the writer's timeout: 60_000.

Reviewer checklist

  • Gemini GEMINI_TOOL_MAPsave_memory is no longer listed in the upstream tools reference (Memory category now shows activate_skill / get_internal_docs). Decide whether to drop the stale save_memory: "Memory" entry from src/hooks/types.ts and whether to map the new tools. Note: save_memory is also pinned in __tests__/hooks/integrations.test.ts:1296 and __tests__/hooks/handler.test.ts:683, so a removal must update those. Not auto-applied because a two-agent read of a reorganized docs page could miss a moved entry, and dropping a live mapping would regress canonicalization if save_memory still exists.
  • Pi PI_TOOL_MAPglob → Glob maps a tool absent from the audited upstream set (find/ls are documented instead and unmapped). Decide the canonical mapping (find → Glob vs Grep; ls → LS) and whether to drop glob. Not auto-applied because: (a) the canonical mapping is a human decision, (b) any change must be mirrored into pi-extension/index.ts (the in-process shim, outside this run's allowed edit scope) and __tests__/hooks/handler.test.ts:977, and (c) source ambiguity — see Unverified notes.

Sources

Unverified notes

  • No CLI was fully unverified (every CLI yielded a parseable enumeration), but two source caveats affect confidence:
    • Pi: the run's docs URL (npmjs.com/@mariozechner/pi-coding-agent) returned HTTP 403; the audit fell back to the authoritative event/tool enumeration in the repo linked from the npm repository field (badlogic/pi-mono extensions.md). Importantly, that npm package is deprecated in favor of @earendil-works/pi-coding-agent, which this repo's own code comments cite as the integration target. The glob vs find/ls discrepancy may therefore reflect a fork difference rather than drift in the repo's actual target — confirm against @earendil-works/pi-coding-agent before acting.
    • Codex: the run's docs URL (developers.openai.com/codex/hooks) now 308-redirects to learn.chatgpt.com/docs/hooks. The current docs present event names in PascalCase; the repo's snake_case CODEX_HOOK_EVENT_TYPES is an internal canonicalization enum and its writer already emits the matching PascalCase keys, so this is not drift.

CI is expected to fail on this PR if a map-bearing CLI gained new events — a reviewer must add the missing *EVENT_MAP entries (replacing "???") before merging. For drift in Claude or Copilot only (no event map), CI should pass on this commit alone. CI must pass and this PR must be reviewed before merging.

(No map-bearing CLI gained new events in this run, so CI is expected to pass on this commit — the two drift items are checklist-only.)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added changelog entry for version 0.0.13-beta.3.
    • Documented an audit of agent CLI hook integrations against upstream documentation.
    • Recorded tool mapping discrepancies for review and clarified that Pi’s expanded event coverage is intentional.

Audit of all seven integrated agent CLIs (Claude, Codex, Copilot, Cursor,
OpenCode, Pi, Gemini) against their current upstream hook docs. Five are up
to date; two show scope-2 tool-map drift that needs a human decision, so they
are surfaced in the PR reviewer checklist rather than auto-edited:

- Gemini: save_memory no longer in the upstream tools reference; GEMINI_TOOL_MAP
  entry is now stale.
- Pi: PI_TOOL_MAP maps `glob`, absent from the audited upstream tool set
  (find/ls documented instead) — and the audited package is deprecated in
  favor of @earendil-works/pi-coding-agent, so confirm the real target first.

No hook-event-name (scope 1) or settings-file-shape (scope 3) drift found.
Pi's larger upstream event surface is intentional curation, not drift.

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

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 170017a8-414b-47e3-b9f9-2e6318e8e4fb

📥 Commits

Reviewing files that changed from the base of the PR and between 83229a7 and 202759f.

📒 Files selected for processing (1)
  • CHANGELOG.md

📝 Walkthrough

Walkthrough

Adds the 0.0.13-beta.3 changelog entry documenting the seven-agent CLI hook harness audit and two identified tool-map discrepancies.

Changes

Audit documentation

Layer / File(s) Summary
Record audit findings
CHANGELOG.md
Adds the 0.0.13-beta.3 fixes entry, documenting Gemini and Pi tool-map drifts and Pi’s intentional event-surface differences.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: chhhee10, hermes-exosphere

Poem

I’m a rabbit with changelog cheer,
Seven harnesses audited here.
Gemini and Pi show drift in sight,
Flagged for review, not changed tonight.
Hop, hop—release notes glow bright!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR is detailed, but it omits the required Type of Change and Checklist sections from the repository template. Add the missing template sections with the checkbox items for lint, typecheck, tests, and build, and mark the appropriate change type.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: syncing agent CLI harnesses with upstream docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

@hermes-exosphere

Copy link
Copy Markdown

🔍 Automated code review started — analyzing [{"additions":5,"deletions":0,"path":"CHANGELOG.md"}] files, +5/-0...

⏱️ This may take a few minutes. Results will be posted here when complete.

Comment thread CHANGELOG.md

## 0.0.13-beta.3 — 2026-07-12

### Fixes

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Suggestion (non-blocking) — ### Fixes should be ### Docs

This entry sits under ### Fixes, but the PR changes only CHANGELOG.md and — as the PR description states — "makes no code changes." The two *_TOOL_MAP drifts (Gemini save_memory, Pi glob) were deliberately not fixed; they were deferred to the reviewer checklist. So nothing was actually fixed in 0.0.13-beta.3.

Per this repo's CLAUDE.md changelog guidance:

  • Fixes for bug fixes
  • Docs for documentation-only changes

A documentation/audit entry with no code change belongs under ### Docs.

Suggested fix: rename this heading from ### Fixes to ### Docs.

Not blocking — CI is unaffected, and the version/date/heading are all consistent (0.0.13-beta.3 — 2026-07-12). This is release-hygiene only.

@hermes-exosphere

Copy link
Copy Markdown

🔍 Automated Code Review

📋 Executive Summary

This is a documentation-only PR: a single +5/-0 CHANGELOG.md entry recording an automated audit of all seven agent-CLI hook harnesses against upstream docs. No source, test, or config files changed. I verified every factual claim in the entry against the code — they all hold — and confirmed CI will pass. One non-blocking nit: the entry is filed under ### Fixes, but nothing was fixed (both flagged drifts were deliberately deferred), so per this repo's own CLAUDE.md it should be ### Docs.


📊 Change Architecture

graph TD
    A[7 CLI hook harnesses<br/>types.ts: *_TOOL_MAP + *_HOOK_EVENT_TYPES] -->|audited vs upstream docs| B{Drift?}
    B -->|Claude · Codex · Copilot<br/>Cursor · OpenCode| C[Up to date — no change]
    B -->|Gemini save_memory<br/>Pi glob| D[Tool-map drift flagged]
    D -->|human decision — deferred| E[Reviewer checklist<br/>in PR body]
    D -->|documented, not auto-edited| F[New: CHANGELOG.md entry<br/>0.0.13-beta.3]
    style F fill:#90EE90
    style D fill:#FFD700
    style A fill:#87CEEB
Loading

Legend: 🟢 New (CHANGELOG entry) · 🔵 Modified · 🟡 Drift flagged & deferred


🔴 Breaking Changes

None. No code, schema, API, config, dependency, or serialization changes — the diff is one Markdown paragraph.


⚠️ Issues Found

  1. 🔵 Info (non-blocking)CHANGELOG.md:5 — Entry is under ### Fixes, but this is a documentation-only change (nothing was fixed; both drifts deferred). Per CLAUDE.md, documentation-only changes go under ### Docs. See inline comment.
  2. 🔵 Info — commit 202759f uses a feat: prefix for a changelog-only, no-code change. Cosmetic; harmless if squash-merged.
  3. 🔵 Info — the entry is a ~6-sentence paragraph vs the CLAUDE.md "single line" guidance — but this is consistent with existing entries in the file (e.g. the 0.0.13-beta.1 Hermes entries), so not a regression.

No 🔴 Critical or 🟡 Warning issues.


🔬 Logical / Bug Analysis

No executable code changed, so there are no logic paths to analyze. Instead I fact-checked the changelog's claims against the source — the value of this PR is its accuracy:

Claim in entry Verified against Result
GEMINI_TOOL_MAP maps save_memory src/hooks/types.ts:620 (save_memory: "Memory") ✅ present
PI_TOOL_MAP maps glob; find/ls unmapped src/hooks/types.ts:478‑485 ✅ correct
Pi subscribes to a curated 7-event set PI_HOOK_EVENT_TYPES (7 entries) ✅ exact
Reviewer-checklist test refs integrations.test.ts:1296, handler.test.ts:683, handler.test.ts:977 ✅ all resolve
Version/date consistency package.json = 0.0.13-beta.3; today = 2026-07-12 ✅ match

On the deferral decision: deferring both drifts rather than auto-editing is sound. Removing save_memory → Memory / glob → Glob would be a no-op if the tools are gone but a canonicalization regression if they still exist, and the PR correctly notes the audited Pi package (@mariozechner/pi-coding-agent) is deprecated in favor of @earendil-works/pi-coding-agent — so acting on unverified drift would be risky. Leaving the mappings in place is the safe call.


🧪 Evidence — Build & Test Results

No Docker/web-UI to exercise (markdown-only diff). I ran the one CI check semantically tied to a version+changelog PR and confirmed the rest are unaffected.

version-consistency check (from .github/workflows/ci.yml quality job)
version-consistency check: PASS (root=0.0.13-beta.3, packages/ dirs found=0)
CHANGELOG top heading: ## 0.0.13-beta.3 — 2026-07-12
package.json version : 0.0.13-beta.3

The check loops over packages/*/package.json (none exist) and packages/wrapper/package.json (absent, guarded by || true), so it passes trivially — and the top heading matches the root version.

Diff scope & branch state
Changed files (PR vs main):
CHANGELOG.md            (+5 / -0)

Commits on branch not on main:
202759f feat: sync agent CLI harnesses with upstream docs

Main commits missing from branch: (none — branch is up to date with main)
lint / tsc / test / build
Unaffected — the diff touches only CHANGELOG.md (Markdown). eslint lints code (not the changelog),
tsc sees no TS change, vitest sees no source/test change, and the build has no new inputs. There is
also no CI changelog-format validator (grep of .github/ + scripts/ found none).

Note: the untracked, 0-byte claude-output.txt in the working tree is a review-session artifact, not part of this PR, and was left untouched.


🔗 Issue Linkage

⚠️ No issue linked (expected — this is an automated release-hygiene PR generated by the hook-sync container). The PR body's per-CLI table and reviewer checklist provide adequate traceability. The two flagged drifts are good candidates for follow-up tracking issues once the real Pi target (@earendil-works/pi-coding-agent) is confirmed.


💡 Suggestions

  1. Relabel ### Fixes### Docs (inline). The only actionable item.
  2. Consider opening a tracking issue for each deferred drift so the checklist survives the PR merge.
  3. Optional: a feat:docs:/chore: commit prefix would match the no-code reality, if the repo doesn't squash-rewrite.

🏆 Verdict

⚠️ APPROVED WITH SUGGESTIONS — The PR is accurate, honest, and low-risk; every claim checks out against the source and CI will pass. The lone finding is a non-blocking changelog subsection label (FixesDocs). Not merge-blocking.


Automated code review · 2026-07-12

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

Automated review complete. ✅ Approved with one non-blocking suggestion.

Documentation-only PR (only CHANGELOG.md, +5/-0). Every factual claim in the entry was verified against the source (GEMINI_TOOL_MAP.save_memory, PI_TOOL_MAP.glob, the 7-event PI_HOOK_EVENT_TYPES, and all three reviewer-checklist test line refs) — all accurate. Version/date/heading are consistent (0.0.13-beta.3 — 2026-07-12) and the CI version-consistency check passes. The deferral of both tool-map drifts is the correct, safe call.

Sole nit (see inline): the entry is under ### Fixes but nothing was fixed — per CLAUDE.md it should be ### Docs. Not merge-blocking.

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.

2 participants