Skip to content

docs(gemini-task): Gemini works independent packages in parallel, in one PR - #12462

Merged
MarkusNeusinger merged 9 commits into
mainfrom
docs/gemini-scale
Oct 30, 2026
Merged

MarkusNeusinger merged 9 commits into
mainfrom
docs/gemini-scale

Conversation

@MarkusNeusinger

@MarkusNeusinger MarkusNeusinger commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Gemini works independent packages in parallel, in one PR (owner, 2026-10-30). When a brief task has two or more packages marked independent, Gemini in the owner's agy session acts as coordinator: one agy subagent per package (invoke_subagent), at most eight at a time (the owner says when the quota runs short), each in its own Git worktree on a package branch gemini/<slug>-<k> that it pushes before it ends, without a PR or changelog fragment. The coordinator then merges the package branches with git merge --no-ff into gemini/<slug>, runs every package's acceptance and the gates on the result, writes one fragment, and opens one draft PR, because every PR costs a Copilot round, a fragment, CI, a merge, and a deploy. Coupled packages still run one after another on gemini/<slug>. One start line, /gemini-task <slug>, covers every package. Claude reviews per merge commit, so a drifted package stands out, and deletes the package branches after the merge. Without worktree isolation Gemini falls back to sequential work instead of letting two agents share the clone.

  • Basis: a multi-agent research run against the Antigravity docs (23 of 24 sampled claims verified against their sources). Subagents run concurrently, start without the parent's conversation, can each get an isolated Git worktree, and report back; agy deletes the worktree when the subagent ends, hence push-before-finish. /teamwork (fixed roles, paid plans) builds in ~/teamwork_projects/<project> with no branches or PRs in its docs, so the skill rules it out for this repository. The docs give no concurrency limit and no quota figures, so the cap of eight is a starting value. Parallel agents inside the owner's own session are a documented product feature; the FAQ's ban covers a third-party agent driving agy, which stays in force.

  • agy-permissions.json gains the git -C <clone> allow and deny forms (Gemini runs Git with absolute paths, and agy matches prefixes word by word), [ and false, and git merge --no-ff for the coordinator, while merging main stays denied. Regex denies close pushes whose refspec destination is main (gemini/foo:main), bulk pushes, and remote deletions, which a gemini/ prefix allow would otherwise let through (Copilot, high). It equals the owner's live settings.

  • Correction: the 2026-10-16 forum reply on topic 189905 is not marked as Google staff, so the skills, the guardrails, and the gemini_review.py docstring no longer call it one; Google's FAQ remains the authority.

  • Two Copilot rounds addressed: coupled package agents continue on the shared branch, packages are matched by an exact <slug>-<number>.md, one coordinator session per task, single commands in the gate block, and the brief template's branch line by package kind.

Plan

N/A

Test plan

  • tests/unit/test_agent_instructions.py: 36 passed
  • ruff check and ruff format --check on gemini_review.py (docstring only)
  • agy-permissions.json is valid JSON and equals the owner's live permissions block with the home path generalised
  • uv run python -m tools.changelog check --base origin/main
  • Unverified until the first multi-package brief: whether the CLI's invoke_subagent offers the worktree mode (the CLI docs do not describe it; the CLI changelog v1.2.10 mentions subagent worktrees)
  • No Gemini Flash check: instruction files, a JSON reference, a docstring, and a changelog fragment only

🤖 Generated with Claude Code

The owner wants Gemini to scale out when there is work for several agents.
Research against the Antigravity docs (2026-10-30): agy subagents
(invoke_subagent) run concurrently, start without the parent's history,
can each get an isolated Git worktree that agy deletes when they end;
/teamwork builds in ~/teamwork_projects/<project> without branches or PRs.

- Briefs mark packages independent or coupled; one start line,
  /gemini-task <slug>, covers every package.
- Gemini as coordinator starts one subagent per independent package, at
  most four at a time, each in its own worktree on gemini/<slug>-<k>,
  pushing and opening its draft PR before it ends; without worktree
  isolation it falls back to one package after another.
- agy-permissions.json gains the git -C <clone> forms the owner's live
  settings already carry.
- The 2026-10-16 forum reply is not marked as Google staff; the FAQ is the
  authority (skills, guardrails, gemini_review.py docstring).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 29, 2026 23:14
…ecks

Gemini chained the brief's acceptance commands into one line with cd ..
and a [ ... ] test; agy asked for those two pieces.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Approval is blocked by an unaddressed critical permission-rule bypass that could allow pushes directly to the protected branch, along with several documentation and workflow inconsistencies.

5 open issues
What changed in this PR

This PR expands the Gemini task workflow to run independent packages in parallel through isolated agy subagents while keeping coupled packages sequential. It also updates Git permissions, safety guidance, provenance wording, and changelog documentation.

Changes:

  • Documents package classification, parallel coordination, isolated worktrees, branch naming, and draft PR handoffs.
  • Extends agy Git permissions for the dedicated Gemini clone.
  • Corrects the attribution of the 2026-10-16 forum reply across related guidance and documentation.
  • Records the updated workflow in the changelog.
File Description
CLAUDE.md Updates agent-selection guidance for parallel Gemini packages.
changelog.d/​gemini-scale-out.md Records the new Gemini package workflow.
.claude/​skills/​zweitmeinung/​SKILL.md Corrects the forum-reply attribution in safety guidance.
.claude/​skills/​zweitmeinung/​gemini_review.py Removes the incorrect staff-attribution claim from the module docstring.
.claude/​skills/​gemini-task/​SKILL.md Defines package classification, parallel subagents, worktree handling, and multi-package startup.
.claude/​skills/​gemini-task/​agy-permissions.json Adds path-qualified Git permissions and additional deny rules.
.claude/​guardrails.md Documents parallel Gemini execution and the corrected forum-reply attribution.

Review effort: Lite

Comment thread .claude/skills/gemini-task/agy-permissions.json Outdated
Comment thread .claude/skills/gemini-task/SKILL.md Outdated
Comment thread .claude/skills/gemini-task/SKILL.md
Comment thread .claude/skills/gemini-task/SKILL.md Outdated
Comment thread CLAUDE.md Outdated
Owner, 2026-10-30: subagents should not open one PR each (every PR costs
a Copilot round, a fragment, CI, a merge, and a deploy), and the limit may
go higher. Subagents now push package branches gemini/<slug>-<k> without a
PR or fragment; the coordinator merges them with git merge --no-ff into
gemini/<slug>, runs the gates on the result, writes one fragment, and opens
one draft PR. Claude reviews per merge commit and deletes the package
branches after the merge. agy rules allow git merge --no-ff and deny
merging main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MarkusNeusinger MarkusNeusinger changed the title docs(gemini-task): Gemini works independent packages in parallel docs(gemini-task): Gemini works independent packages in parallel, in one PR Oct 29, 2026
MarkusNeusinger and others added 2 commits October 30, 2026 00:24
In the first live brief run agy asked the owner for every chained check
with subshells, command substitution, or || true; single commands match
the permission rules.

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

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… flow

Copilot review of #12462:
- A prefix allow such as git push origin gemini/ also matched
  gemini/foo:main. Regex denies now catch any refspec whose destination is
  main, and --all, --mirror, --delete, --tags, --prune, and ':branch'
  deletions (the owner's live settings carry the same rules).
- The brief template names the package branch gemini/<slug>-<k> for
  independent packages and gemini/<slug> for coupled ones.
- One start line per task: the session is the coordinator; coupled
  packages run one fresh subagent at a time in its workspace, so the
  per-package fresh start holds without new sessions.
- The package glob is <slug>-[0-9]*.md, so another task's brief with the
  same prefix stays out.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Active critical and moderate findings remain in the task workflow and permission configuration, including unsafe package matching, incorrect coupled-branch handling, an unsplit approval-triggering gate, and an overly broad directory-change allow rule.

4 open issues
5 resolved since last review

Review effort: Lite

Comment thread .claude/skills/gemini-task/SKILL.md Outdated
Comment thread .claude/skills/gemini-task/SKILL.md Outdated
Comment thread .claude/skills/gemini-task/agy-permissions.json Outdated
Comment thread .claude/skills/gemini-task/SKILL.md Outdated
MarkusNeusinger and others added 2 commits October 30, 2026 00:45
On the merged branch every package's 'only my files changed' check sees
the other packages' files; gates and tests run on the merged result, path
checks per package branch.

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

Second Copilot round on #12462:
- A coupled package's subagent continues on the tip of gemini/<slug>
  instead of starting a fresh package branch from origin/main, which would
  have dropped the previous packages' commits.
- cd .. leaves the allow list (live settings and reference): the absolute
  clone paths cover every needed cd, and a prefix match could otherwise
  move Gemini out of the clone.
- Packages are found with find -regex '<slug>-[0-9]+\.md', so
  <slug>-1-other.md stays out; the clean-up step uses the same match.
- The gate block lists one command per line; app/ gates run one by one.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Approval is blocked by an unresolved critical path-traversal permission issue and a missing documented package-branch integration step.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

High severity Constrain git -C allows to the exact clone path

.claude/​skills/​gemini-task/​agy-permissions.json:89

The new git -C allow entries are prefix-based, so a command such as git -C /home/<user>/projects/anyplot-agy/../anyplot add ... begins with the allowed clone path but resolves to the shared checkout. That bypasses the dedicated-clone rule and reintroduces the path-traversal problem that was removed for cd ..; constrain these rules to the exact clone path (or explicitly deny traversal) before relying on them for isolation.

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

  • line 157
  • line 159
4 resolved since last review

Review effort: Lite

Comment thread .claude/skills/gemini-task/SKILL.md Outdated
Copilot (third round, low): the coordinator needs an explicit step to
reach gemini/<slug> before merging the package branches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MarkusNeusinger
MarkusNeusinger merged commit 3816b36 into main Oct 30, 2026
18 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the docs/gemini-scale branch October 30, 2026 00:15
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