Skip to content

feat(acp): apply model/effort for generic ACP workers via advertised config options - #41

Open
qq75221502-cell wants to merge 1 commit into
Fei2411:mainfrom
qq75221502-cell:acp-generic-model
Open

qq75221502-cell wants to merge 1 commit into
Fei2411:mainfrom
qq75221502-cell:acp-generic-model

Conversation

@qq75221502-cell

@qq75221502-cell qq75221502-cell commented Nov 19, 2026 •

Copy link
Copy Markdown

## Problem

Custom ACP workers (any [agents.<name>] with protocol = "acp", e.g. Google Antigravity's agy acp) are not in _MODEL_EFFORT_AGENTS, so dispatch_task's model/effort are silently ignored (only a task warning). The worker always runs its default model — for agy acp that is Gemini 4 Neon regardless of the requested model.

Meanwhile such sessions often do advertise the standard typed config surface. agy acp (v1.5.12) session/new returns:

  • configOptions[id=model]: base families (gemini-4-neon, gemini-3.8-flash, claude-opus-5-5, …)
  • configOptions[id=thought_level]: low / medium / high / xhigh

## Change

Add _sync_generic_acp_selection, appended to _sync_selection:

  • For agents outside _MODEL_EFFORT_AGENTS, if the session advertises a model option, apply session.model through the existing _sync_model_option (same fail-loud semantics as the named agents).
  • Tiered coordinator slugs that miss the advertised family list are split into family + tier (gemini-3.8-flash-high → model gemini-3.8-flash, tier high); session.model is rewritten to the applied family so state/audits record reality. This matters for workers like the built-in antigravity adapter whose ids carry the tier.
  • The effort (explicit effort or the tier split out above) is applied to the first advertised option among thought_level / effort / reasoning_effort / thinking; a value with no counterpart warns instead of failing.
  • run_turn's "model/effort were ignored" warning now checks live.applied_model, so a successfully synced generic worker no longer reports the selection as ignored.

Named agents (grok, kimi, zcode, …) keep their dedicated sync paths untouched; the generic path self-exits for them.

## Evidence

Local install patched identically (Windows, agy 1.5.12, worker antigravity-acp = agy acp):

  • Before: identity probe answers "Gemini 4 Neon" for every requested model (default; selection dropped).
  • After: model=gemini-3.8-flash + thought_level=low → answers "Gemini 3.8 Flash"; gemini-4-neon + high → "Gemini 4 Neon,思考档位:高"; claude-opus-5-5 + low → "Claude Opus 5.5".

Happy to add a unit test against a fake ACP worker advertising model + thought_level if you point me at the preferred fixture style.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T17:09:32.080561Z 78b7f52 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@qq75221502-cell qq75221502-cell changed the title feat(acp): sync model/effort for generic ACP workers via advertised config options feat(acp): apply model/effort for generic ACP workers via advertised config options Nov 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78b7f5236d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1540 to +1541
_current, offered = config_option_values(live.config_options, "model")
if offered and session.model not in offered:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Cache advertised config options for generic ACP workers

For custom ACP workers, _remember_config_options() still returns early unless the name is in _CONFIG_OPTION_AGENTS, but every name in that set is excluded from this fallback. Consequently, lifecycle and config-update responses never populate live.config_options for workers reaching this code. Generic effort selection never runs, and a tiered ID such as gemini-3.8-flash-high is sent unchanged and rejected even when the worker advertises the corresponding family and effort. Allow generic workers to populate and refresh the config snapshot before using it here.

Useful? React with 👍 / 👎.

if self.agent.name not in _MODEL_EFFORT_AGENTS and (task.model or task.effort):
if (
self.agent.name not in _MODEL_EFFORT_AGENTS
and not live.applied_model

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Warn when effort is ignored despite an applied model

When a generic worker accepts the model but advertises no supported effort option, _sync_model_option() sets live.applied_model, while the effort-option loop exhausts its candidates without adding a warning. This new condition then suppresses the existing ignored-parameter warning too. A dispatch with a valid model and effort=high therefore completes with unchanged effort and an empty warnings list, leaving the coordinator unaware that its effort request was ignored. Check effort support separately or emit a warning when no compatible effort option exists.

Useful? React with 👍 / 👎.

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