Skip to content

Add custom agent reasoning effort across SDKs#1981

Open
roji wants to merge 5 commits into
mainfrom
roji-custom-agent-reasoning-effort
Open

Add custom agent reasoning effort across SDKs#1981
roji wants to merge 5 commits into
mainfrom
roji-custom-agent-reasoning-effort

Conversation

@roji

@roji roji commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add optional per-agent reasoning effort to every SDK binding
  • serialize the wire field as reasoningEffort without adding an SDK default
  • document finalized omission semantics: when per-agent effort is omitted, the SDK sends no override and the backend chooses its default; the parent/session effort is not inherited
  • add focused serialization, cloning, builder, and DTO tests

This is SDK-side changes to support https://github.com/github/copilot-agent-runtime/pull/11166 (runtime PR).

Closes github/copilot-sdk-internal#195.

Validation

  • Node.js: Prettier, ESLint, TypeScript typecheck, targeted Vitest (3 passed)
  • Python: Ruff, ty, targeted pytest (4 passed)
  • Go: gofmt, go vet, targeted go test
  • .NET: dotnet format, targeted tests (34 passed)
  • Java: Spotless, Checkstyle, targeted Maven verify (27 passed; integration tests skipped)
  • Rust: rustfmt, Clippy library target, targeted tests (7 passed)

Expose an optional per-agent reasoning effort across every SDK binding while preserving omission semantics and the reasoningEffort wire name. Add focused serialization, cloning, builder, and DTO coverage plus custom-agent documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 32727fc4-2ac8-41eb-a68a-e74674ecf155
Copilot AI review requested due to automatic review settings July 14, 2026 14:00
@roji roji requested a review from a team as a code owner July 14, 2026 14:00
Document that omitted per-agent reasoning effort inherits an explicit parent session effort, while omission at both levels leaves the backend to choose.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 32727fc4-2ac8-41eb-a68a-e74674ecf155

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.

Pull request overview

Adds optional per-agent reasoning effort across all SDKs while preserving wire omission semantics.

Changes:

  • Adds language-specific custom-agent reasoning effort APIs.
  • Serializes the field as reasoningEffort.
  • Adds tests and documentation.
Show a summary per file
File Description
rust/src/types.rs Adds Rust field, builder, and tests.
python/test_client.py Tests Python wire conversion.
python/copilot/session.py Adds Python typed configuration.
python/copilot/client.py Converts the field to camel case.
nodejs/test/client.test.ts Tests Node.js request payloads.
nodejs/src/types.ts Adds the TypeScript property.
java/src/test/java/com/github/copilot/DataObjectCoverageTest.java Tests Java DTO behavior.
java/src/main/java/com/github/copilot/rpc/CustomAgentConfig.java Adds Java getter and setter.
go/types.go Adds the Go JSON field.
go/types_test.go Tests Go serialization and omission.
dotnet/test/Unit/SerializationTests.cs Tests .NET serialization.
dotnet/test/Unit/CloneTests.cs Covers cloning the new property.
dotnet/src/Types.cs Adds the .NET property.
docs/features/custom-agents.md Documents model and reasoning overrides.

Review details

  • Files reviewed: 14/14 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread dotnet/test/Unit/SerializationTests.cs Outdated
Comment thread dotnet/test/Unit/SerializationTests.cs Outdated
@github-actions

This comment has been minimized.

Align every binding's CustomAgentConfig description with runtime inheritance semantics for omitted reasoning effort.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 32727fc4-2ac8-41eb-a68a-e74674ecf155
@github-actions

This comment has been minimized.

Capture session.create requests through the public .NET client path instead of reflecting into private serializer options.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 32727fc4-2ac8-41eb-a68a-e74674ecf155
@github-actions

This comment has been minimized.

Document that omitted per-agent reasoning effort sends no override and lets the backend choose its default rather than inheriting the parent session effort.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 32727fc4-2ac8-41eb-a68a-e74674ecf155
@github-actions

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR adds reasoningEffort to CustomAgentConfig consistently across all six SDK implementations. The changes are well-aligned:

SDK Field name Wire name Type
Node.js reasoningEffort reasoningEffort ReasoningEffort (typed)
Python reasoning_effort reasoningEffort ReasoningEffort (typed)
Go ReasoningEffort reasoningEffort string
.NET ReasoningEffort reasoningEffort string?
Java reasoningEffort / setReasoningEffort reasoningEffort String
Rust reasoning_effort reasoningEffort Option<String>

All SDKs:

  • Omit the field when unset (no default injected)
  • Document the same omission semantics (backend chooses default; parent effort not inherited)
  • Include serialization tests verifying both presence and absence

The naming conventions (camelCase for TS/Java, snake_case for Python/Rust, PascalCase for Go/.NET) match each language's established patterns and are consistent with how the existing model field is handled in the same struct.

No consistency issues found.

Generated by SDK Consistency Review Agent for issue #1981 · sonnet46 430.9K ·

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