Skip to content

v1.0.10-preview.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 07 Aug 14:09
846b34b

Feature: history.clearContext and Tool.isTerminal across all SDKs

Two new capabilities are available in every SDK language:

history.clearContext clears the conversation context (keeping system and developer messages) and seeds the fresh context window with a required first user message. It can only be called from inside a tool handler with a tool call in flight. Also picks up the new session.context_cleared event. (#2129)

Tool.isTerminal lets a tool declare that a successful call ends the agent turn 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. (#2129)

const session = await joinSession({
    tools: [{
        name: "clear_context",
        isTerminal: true,
        defer: "never",
        parameters: {
            type: "object",
            properties: { prompt: { type: "string" } },
            required: ["prompt"],
        },
        handler: async ({ prompt }) => {
            const { messagesCleared } = await session.rpc.history.clearContext({ prompt });
            return { textResultForLlm: `Cleared ${messagesCleared} message(s).`, resultType: "success" };
        },
    }],
});
session.DefineTool("clear_context", new ToolOptions { IsTerminal = true, Defer = DeferMode.Never }, async (params) => {
    var result = await session.Rpc.History.ClearContext(new ClearContextParams { Prompt = params.Prompt });
    return ToolResult.Success($"Cleared {result.MessagesCleared} message(s).");
});

Feature: managed permission settings at session startup

Hosts can now inject enterprise permission policy at session startup across all six SDKs. This is independent of the runtime's server-managed settings fetch path. (#2139)

const session = await createSession({
    managedSettings: {
        permissions: {
            disableBypassPermissionsMode: "disable",
            deny: ["shell"],
            allow: ["read_file"],
        },
    },
});
var session = await CopilotClient.CreateSessionAsync(new SessionOptions {
    ManagedSettings = new ManagedSettings {
        Permissions = new ManagedPermissions {
            DisableBypassPermissionsMode = "disable",
            Deny = ["shell"],
            Allow = ["read_file"],
        }
    }
});

Other changes

  • bugfix: [Java] preserve MCP permission extension data (serverName, toolName, args) in PermissionRequest.extensionData (#2276)
  • bugfix: [Rust] recover JSON-RPC frames containing unpaired UTF-16 surrogates instead of closing the connection (#2283)

New contributors

  • @Chuxel made their first contribution in #2283

Generated by Release Changelog Generator · sonnet46 19 AIC · ⌖ 5.28 AIC · ⊞ 8.6K