Skip to content

refactor(agent): declare adapter capabilities - #217

Merged
JHWang-1997 merged 5 commits into
mainfrom
refactor/agent-capabilities
Aug 26, 2026
Merged

JHWang-1997 merged 5 commits into
mainfrom
refactor/agent-capabilities

Conversation

@zpzjzj

@zpzjzj zpzjzj commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • declare adapter protocol, model, endpoint, and kwarg capabilities
  • resolve requested versus applied configuration once for runner and judge, surfacing unsupported explicit settings before execution
  • record credential-free requested/applied configuration in sessions, telemetry, JSON, HTML, and Markdown while preserving legacy model_name semantics
  • record observed model identity only when the agent explicitly reports it; local/default selection remains unknown
  • document the future boundary between provider configuration, a protocol-aware resolved model connection, adapter materialization, and agent-native configuration

Configuration semantics

  • requested_configuration: values selected through YAML, CLI, environment, and credential precedence
  • applied_configuration: values skill-up forwards to the CLI after adapter normalization; local CLI settings may still override them
  • observed_configuration: emitted only when every runner session explicitly reports the same model; per-case observations remain in observed_model

When Codex cannot apply a requested custom provider, its applied provider, model, endpoint, and provider-scoped credential are all omitted before falling back to local Codex settings.

Custom engines consume the top-level provider/model/API-key identity, but custom endpoints and parameters remain under engine.custom.http.url and engine.custom.kwargs; unused top-level base_url or engine.kwargs are now surfaced rather than reported as applied.

Capability warnings do not include configured kwarg values, preventing an accidentally supplied credential from being persisted in logs or result.json.

No auth probe or extra model request is introduced, so existing local CLI login remains valid without consuming tokens merely to inspect state.

Model connection follow-up

The design follows Harbor's useful layering (ProviderAccess -> ResolvedModelConnection -> native agent config) without copying its model-based provider inference or credential alias fan-out. Protocol-aware connection resolution, adapter materialization, --provider compatibility, and native configuration remain staged follow-ups in #196 rather than expanding this PR.

Compatibility

  • no eval schema or CLI flag changes
  • legacy provider/model parsing and top-level model_name semantics are preserved
  • installation/version lifecycle and protocol-aware connection resolution remain follow-ups

Testing

  • make verify
  • make test
  • make e2e
  • go test -tags e2e -v ./e2e -run TestPipeline_ReportsRequestedAppliedAndUnknownObservedModel -count=1
  • two fixed-SHA self-review passes; the first found and fixed custom capability overclaiming and raw invalid-kwarg warnings, and the second found no actionable defects

One separate self-review-triggered E2E rerun observed the existing local Qoder behavior where a successful run reports zero token usage; the full pre-push make e2e run passed.

Part of #196

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

The requested/effective split is useful, but the effective provider identity can diverge from the provider actually used by Codex when provider configuration falls back to local defaults. The inline comment includes a concrete example and suggested resolution.

Comment thread internal/agent/capabilities.go Resolved
@JHWang-1997
JHWang-1997 enabled auto-merge August 26, 2026 06:15

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

LGTM

@JHWang-1997
JHWang-1997 added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit a5dfe7f Aug 26, 2026
12 checks passed
@zpzjzj
zpzjzj deleted the refactor/agent-capabilities branch August 31, 2026 02:28
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