Skip to content

[pull] main from github:main - #232

Merged
pull[bot] merged 3 commits into
Rashworld786:mainfrom
github:main
Aug 6, 2026
Merged

[pull] main from github:main#232
pull[bot] merged 3 commits into
Rashworld786:mainfrom
github:main

Conversation

@pull

@pull pull Bot commented Aug 6, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

examon and others added 3 commits August 6, 2026 14:03
…2264)

The Python README's "Customize Mode" section listed 10 section IDs and
described "four string actions". The shipped Python API exposes 12
sections (`SystemMessageSection`) and 5 string actions (the literal arm
of `SectionOverrideAction`): `preamble`, `runtime_instructions` and
`preserve` were missing, so following the README it was impossible to
discover them.

Bring the two lines in line with the shipped API and with the equivalent
sections in the Node.js, Go and .NET READMEs and in
docs/getting-started.md, which already document all 12 sections and all
5 actions, including the section-group semantics that make `preamble`
and `preserve` meaningful.

Co-authored-by: examon <examon@users.noreply.github.com>
* fix(java): preserve MCP permission extension data

* test(java): preserve absent permission extension data

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

* style(java): format permission regression test

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

---------

Co-authored-by: j-zhangyiyuan <j-zhangyiyuan@microsoft.com>
Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add history.clearContext and Tool.isTerminal across all SDKs

Regenerates the RPC clients for the new `session.history.clearContext` method
and the `session.context_cleared` event, and adds a hand-authored `isTerminal`
tool flag to every language surface.

`isTerminal` lets a tool declare that a successful call ends the agent turn:
the runtime's tool phase halts instead of feeding the result back to the model
for another round. A failed call leaves the loop running so the model can read
the error and retry. Without it a turn-ending tool can only approximate the
behavior by returning a rejected result, which halts the loop but is
semantically wrong.

Per language:
- Node.js: `Tool.isTerminal`, `defineTool` config, both session-config
  serialization sites.
- Go: `Tool.IsTerminal` with `json:"isTerminal,omitempty"`.
- Python: `Tool.is_terminal`, `define_tool` overloads, both client
  serialization sites.
- Rust: `Tool::is_terminal`, skipped when false.
- Java: `ToolDefinition.isTerminal` as a record component, plus a
  seven-argument convenience constructor so existing call sites keep compiling.
- .NET: `CopilotToolOptions.IsTerminal`, the `is_terminal` additional-property
  key, and the wire `ToolDefinition`.

Adds serialization tests in Go, Rust and Java covering both the camelCase wire
name and omission when unset; the Java test also pins the seven-argument
constructor so the record change stays source-compatible.

* Preserve isTerminal in Java fluent copies, add Node isTerminal wire tests

Resolves the rebase onto main where both sides added an eighth tool
option: main added metadata and this branch added isTerminal.

- Java ToolDefinition now carries metadata and isTerminal as separate
  record components, keeps the seven- and eight-argument convenience
  constructors, and threads isTerminal through every fluent copy method
  so it is no longer dropped by .metadata()/.defer()/etc.
- Adds ToolDefinition.isTerminal(boolean) so lambda-defined tools can
  set it, matching the other flags.
- Adds the missing Node regression tests asserting isTerminal is
  forwarded on both session.create and session.resume, and omitted when
  unset.
- Applies the repo rust formatter to the new is_terminal test.

* Regenerate clearContext bindings for the tightened runtime contract

Mirrors github/copilot-agent-runtime#14002 after review:

- `HistoryClearContextRequest.prompt` is now required. A cleared window
  holding only system and developer messages is not a conversation a model
  can answer, so every clear seeds the window it creates.
- `HistoryClearContextResult` loses the `cleared` discriminator. The RPC now
  rejects the cases it was meant to describe - a remote session, or a call
  made while no tool call is in flight - so there is one error channel
  instead of a success flag plus an error channel.
- `ContextClearedData.prependMessages` is gone. It had no producer, and it
  was a permanent commitment on a durable event for a code path nothing
  exercised.

Regenerated with `scripts/codegen`; only the clear-context hunks are taken,
so unrelated schema drift stays out of this PR.

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

* Close the two remaining reviewer findings on isTerminal

The automated reviewer raised two suppressed findings against the new
Tool.isTerminal field. Both were accurate.

Rust: Tool has a hand-written Debug impl that enumerates every other
serializable field, so is_terminal was silently missing from its output
and a terminal tool debug-printed identically to a plain one. Add the
field in declaration order, plus a test that fails if the hand-written
impl drifts again.

Python: dotnet, go, java, nodejs and rust all assert that isTerminal
reaches the wire on both the session.create and session.resume paths and
is omitted at its default. Python was the only SDK without that
coverage. Add the test, mirroring the adjacent tool-metadata test.

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

* Fix @SInCE on the new Java isTerminal setter

ToolDefinition.isTerminal(boolean) is introduced by this PR but was
tagged @SInCE 1.0.7, a version released long ago in which the method did
not exist, so the generated javadoc would misstate its availability.

1.0.11 is the current unreleased version: the pom is at
1.0.10-preview.3-SNAPSHOT, and the eight java/src/main files carrying
@SInCE 1.0.11 include ToolDefinition.createOverride in this same file.

This was the only @SInCE tag the PR added.

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

* Expose isTerminal through Java tool annotations

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

* Test .NET terminal tools on session requests

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

* Cover terminal tool runtime behavior end to end

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

* Document context clearing and terminal tools

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

* Normalize clear context snapshot formatting

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

---------

Co-authored-by: examon <examon@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators Aug 6, 2026
@pull pull Bot added the ⤵️ pull label Aug 6, 2026
@pull
pull Bot merged commit 4e95dee into Rashworld786:main Aug 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants