Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: github/copilot-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 579f975
Choose a base ref
...
head repository: github/copilot-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bd9ec8c
Choose a head ref
  • 4 commits
  • 88 files changed
  • 6 contributors

Commits on Mar 20, 2026

  1. fix(dotnet): handle unknown session event types gracefully (#881)

    * fix(dotnet): handle unknown session event types gracefully
    
    Add UnknownSessionEvent type and TryFromJson method so that unrecognized event types from newer CLI versions do not crash GetMessagesAsync or real-time event dispatch.
    
    * refactor: use IgnoreUnrecognizedTypeDiscriminators per review feedback
    Ron537 authored Mar 20, 2026
    Configuration menu
    Copy the full SHA
    d82fd62 View commit details
    Browse the repository at this point in the history
  2. fix: Go codegen enum prefixes and type name reconciliation (#883)

    * Update @github/copilot to 1.0.10-0
    
    - Updated nodejs and test harness dependencies
    - Re-ran code generators
    - Formatted generated code
    
    * refactor(go): update handwritten files to use prefixed enum constant names
    
    Rename all references to copilot session event type and rpc constants
    to use the new prefixed naming convention matching the generated code:
    
    - copilot.SessionCompactionStart -> copilot.SessionEventTypeSessionCompactionStart
    - copilot.ExternalToolRequested -> copilot.SessionEventTypeExternalToolRequested
    - copilot.PermissionRequested -> copilot.SessionEventTypePermissionRequested
    - copilot.ToolExecutionStart -> copilot.SessionEventTypeToolExecutionStart
    - copilot.AssistantReasoning -> copilot.SessionEventTypeAssistantReasoning
    - copilot.Abort -> copilot.SessionEventTypeAbort
    - rpc.Interactive -> rpc.ModeInteractive
    - rpc.Plan -> rpc.ModePlan
    - rpc.Warning -> rpc.LevelWarning
    - rpc.Error -> rpc.LevelError
    - rpc.Info -> rpc.LevelInfo
    (and all other constants listed in the rename)
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: Go codegen enum prefixes and type name reconciliation
    
    - Add 'mcp' to goInitialisms so toPascalCase produces SessionMCP* matching quicktype
    - Post-process enum constants to use canonical Go TypeNameValue convention
      (replaces quicktype's Purple/Fluffy/Tentacled prefixes and unprefixed constants)
    - Reconcile type names: extract actual quicktype-generated struct names and use them
      in RPC wrapper code instead of recomputing via toPascalCase
    - Extract field name mappings from quicktype output to handle keyword-avoidance renames
    - Update all handwritten Go references to use new prefixed constant names
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * docs: update Go image-input examples to use copilot.AttachmentTypeFile
    
    The generated enum constant was renamed from copilot.File to
    copilot.AttachmentTypeFile to follow Go's TypeNameValue convention.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix(codegen): resolve Python type names from quicktype output for acronyms
    
    The Python codegen used toPascalCase() to compute type names like
    SessionMcpListResult, but quicktype generates SessionMCPListResult
    (uppercase MCP). This caused runtime NameError in Python scenarios.
    
    Apply the same approach as go.ts: after quicktype runs, parse the
    generated output to extract actual class names and build a
    case-insensitive lookup map. Use resolveType() in emitMethod() and
    emitRpcWrapper() instead of recomputing names via toPascalCase().
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: update Go E2E tests for agent list and multi-client timeout
    
    - TestAgentSelectionRpc: CLI now returns built-in agents, so instead of
      asserting zero agents, verify no custom agents appear when none configured
    - TestMultiClient: increase broadcast event timeout from 10s to 30s
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix LogAsync compilation error by adding missing url parameter
    
    The generated Rpc.LogAsync method added a 'url' parameter between
    'ephemeral' and 'cancellationToken', causing a type mismatch when
    Session.LogAsync passed cancellationToken as the 4th positional arg.
    
    Added the 'url' parameter to Session.LogAsync to match the generated
    Rpc method signature and pass it through correctly.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: address review comments - valuePascal initialisms, Phase 2 regex, add pr/ado
    
    - valuePascal now uses goInitialisms so 'url' -> 'URL', 'mcp' -> 'MCP', etc.
    - Phase 2 regex uses [\s\S]*? to match multi-line func bodies
    - Added 'pr' and 'ado' to goInitialisms
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix Python E2E agent list test for built-in agents
    
    The CLI now returns built-in/default agents even when no custom agents
    are configured. Update the assertion to verify no custom test agent
    names appear in the list, rather than asserting the list is empty.
    Matches the pattern used in the Go E2E test.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Skip multi-client broadcast test across Go, Python, and C#
    
    CLI 1.0.7 no longer delivers broadcast external_tool events to
    secondary clients. Skip the 'both clients see tool request and
    completion events' test in all three languages with a clear note.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Revert multi-client broadcast test skips for CLI 1.0.7
    
    Remove the t.Skip/pytest.skip/Fact(Skip=...) additions that were
    disabling the multi-client broadcast tests across Go, Python, and C#.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: remove mcp/pr/ado from goInitialisms to avoid SessionRpc.MCP rename
    
    resolveType() already handles type name reconciliation from quicktype
    output, so these initialisms aren't needed and would cause an unnecessary
    breaking change to the SessionRpc.Mcp field name.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Another Go codegen fix after rebase
    
    * Regenerate code
    
    * Python formatting
    
    Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Type name update
    
    Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix Python codegen
    
    Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * fix: update copilot.Blob to copilot.AttachmentTypeBlob and fix Python Optional codegen
    
    - Update Go E2E test, README, and docs to use prefixed enum constant
    - Fix Python codegen modernizePython to handle deeply nested Optional types
    - Fix ruff formatting in e2e/test_multi_client.py
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
    4 people authored Mar 20, 2026
    Configuration menu
    Copy the full SHA
    a124096 View commit details
    Browse the repository at this point in the history
  3. Add fine-grained system prompt customization (customize mode) (#816)

    * Add fine-grained system prompt customization (customize mode)
    
    Add a new 'customize' mode for systemMessage configuration, enabling
    SDK consumers to selectively override individual sections of the CLI
    system prompt while preserving the rest. This sits between the existing
    'append' and 'replace' modes.
    
    9 configurable sections: identity, tone, tool_efficiency,
    environment_context, code_change_rules, guidelines, safety,
    tool_instructions, custom_instructions.
    
    4 override actions per section: replace, remove, append, prepend.
    
    Unknown section IDs are handled gracefully: content-bearing overrides
    are appended to additional instructions with a warning, and remove
    on unknown sections is silently ignored.
    
    Types and constants added to all 4 SDK languages (TypeScript, Python,
    Go, .NET). Documentation updated across all READMEs and getting-started
    guide.
    
    Companion runtime PR: github/copilot-agent-runtime#4751
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review feedback: fix docs, add examples and E2E tests
    
    - Fix incorrect package name in nodejs/README.md (@anthropic-ai/sdk -> @github/copilot-sdk)
    - Add standalone 'System Message Customization' sections with full
      code examples to Python and Go READMEs (matching TypeScript/.NET)
    - Add E2E tests for customize mode to Python, Go, and .NET
      (matching existing Node.js E2E test coverage)
    - Fix 'end of the prompt' wording in docs to 'additional instructions'
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add last_instructions configurable section
    
    Expose lastInstructions as a customizable section across all 4 SDKs,
    addressing review feedback about duplicate tool-efficiency blocks.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix lint: prettier formatting, Python import order and line length
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add transform operation for system prompt section customization
    
    Adds a new 'transform' action to SectionOverride that enables read-then-write
    mutation of system prompt sections via callbacks. The SDK intercepts function-
    valued actions before serialization, stores the callbacks locally, and handles
    the batched systemMessage.transform JSON-RPC callback from the runtime.
    
    Changes across all 4 SDKs (TypeScript, Python, Go, .NET):
    - Types: SectionTransformFn, SectionOverrideAction (TS/Python), Transform
      field (Go/.NET), SectionOverrideAction constants (Go)
    - Client: extractTransformCallbacks helper, transform callback registration,
      systemMessage.transform RPC handler
    - Session: transform callback storage and batched dispatch with error handling
    - E2E tests and shared snapshot YAML files
    
    Wire protocol: single batched RPC call with all transform sections, matching
    the runtime implementation in copilot-agent-runtime PR #5103.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Formatting
    
    Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add E2E snapshot for customized systemMessage config test
    
    Generate the missing snapshot file that the 'should create a session
    with customized systemMessage config' test requires across all SDK
    languages (Node, Python, Go, .NET).
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix Go fmt blank comment line and Python import ordering
    
    - Add blank // comment line between doc example and extractTransformCallbacks
      function doc comment in go/client.go (required by go fmt)
    - Fix ruff import sorting in python/copilot/__init__.py
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix Python ty type error in session transform handler
    
    Use str() to ensure transform callback result is typed as str,
    fixing the invalid-assignment error from ty type checker at
    session.py:689.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix Python E2E test to use keyword args for create_session
    
    The create_session() method was refactored to keyword-only params.
    Update the customized systemMessage test to use keyword arguments
    instead of a positional dict, and fix send_and_wait() call to pass
    prompt as a positional string.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Assert transform result in system message via HTTP traffic
    
    The 'should apply transform modifications' tests previously only verified
    that the transform callback was invoked, not that the transformed content
    actually reached the model. Now all 4 SDKs assert that TRANSFORM_MARKER
    appears in the system message captured from HTTP traffic.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix Go transform JSON serialization: add json tags for content field
    
    The systemMessageTransformRequest and systemMessageTransformResponse
    used anonymous structs without json tags, causing Content to serialize
    as uppercase 'Content' instead of lowercase 'content'. The CLI expects
    lowercase, so transform results were silently ignored.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
    3 people authored Mar 20, 2026
    Configuration menu
    Copy the full SHA
    005b780 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bd9ec8c View commit details
    Browse the repository at this point in the history
Loading