Skip to content

Align agent mode harness with .NET - #1161

Open
Michelle Clayton (michelle-clayton-work) wants to merge 2 commits into
mainfrom
dev/mclayton/agentmode-parity
Open

Michelle Clayton (michelle-clayton-work) wants to merge 2 commits into
mainfrom
dev/mclayton/agentmode-parity

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Add configurable mode tools, notification suppression, named tool arguments, and matching empty-mode validation.

Add configurable mode tools, notification suppression, named tool arguments, and matching empty-mode validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 22, 2026 23:09
@github-actions github-actions Bot added area:agent Changes files in the agent area size:xlarge More than 300 changed lines or 10 files labels Sep 22, 2026

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.

Copilot review overview

🟢 Approval recommended

No unresolved issues block approval.

Review effort: Lite
Findings: None

What changed in this PR

Aligns the Go agent-mode harness with the .NET implementation.

Changes:

  • Adds configurable mode-tool suppression.
  • Supports named mode_set arguments.
  • Adds notification suppression.
  • Validates empty mode configurations and expands tests.
File Summary
agent/​harness/​agentmode/​agentmode.go Implements configuration, tool, instruction, and notification behavior.
agent/​harness/​agentmode/​agentmode_test.go Tests validation, named arguments, disabled tools, and notifications.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot added kind:code Changes production behavior or code kind:tests Changes tests, fixtures, or test infrastructure labels Sep 22, 2026
Keep the upstream per-tool controls and silent setter while preserving named mode arguments, explicit empty-mode validation, and optional notification suppression.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added size:large At most 300 changed lines across at most 10 files parity-approved Go API consistency review found no parity issues public-api-change Pull Request changes public APIs and removed size:xlarge More than 300 changed lines or 10 files labels Sep 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

API consistency review

Result Scope
aligned public API / user-visible behavior

Changed Go contract

  • agentmode.Config.Modes: semantics changed so nil uses the default plan/execute modes, while a non-nil empty slice now panics ("at least one mode must be configured") instead of silently falling back to defaults.
  • mode_set tool: input schema changed from a generic single positional argument (Arg0) to a named JSON field mode ({"mode": "..."}).
  • Provider.SetModeForSession(session, mode, disableNotification ...bool) error: added an optional variadic disableNotification argument (errors if more than one value is supplied), matching the notification-suppression behavior already present in SetModeForSessionSilently.

Upstream evidence reviewed

Implementation Source Contract checked
.NET AgentModeProviderOptions.csModes property doc: "When null (the default)... uses two built-in modes" Nullable Modes defaults when unset
.NET AgentModeProvider.cs constructor: if (this._modes.Count == 0) throw new ArgumentException("At least one mode must be configured.", ...) Empty (non-null) mode list is invalid, not treated as "use defaults"
.NET Same file, CreateTools: AIFunctionFactory.Create(async (string mode) => ..., new AIFunctionFactoryOptions { Name = "mode_set", ... }) mode_set tool exposes a single named parameter mode, not a positional/generic arg
.NET Same file: SetModeAsync(AgentSession, string, bool disableNotification, CancellationToken) overload alongside the 2-arg overload Optional disableNotification parameter with equivalent state-clearing semantics

Assessment

The Go changes bring agentmode in line with the .NET AgentModeProvider: the nil-vs-empty Modes distinction, the named mode tool argument, and the optional notification-suppression parameter on SetModeForSession all match documented .NET behavior and defaults. The Go variadic-bool pattern for the optional parameter is an idiomatic (not semantic) difference from the .NET method overload. No parity issues found.

Generated by Go API Consistency Review Agent for #1161 · copilot · auto · 60.5 AIC · ⌖ 6.21 AIC · ⊞ 13.7K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Changes files in the agent area kind:code Changes production behavior or code kind:tests Changes tests, fixtures, or test infrastructure parity-approved Go API consistency review found no parity issues public-api-change Pull Request changes public APIs size:large At most 300 changed lines across at most 10 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants