Commit a124096
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>1 parent d82fd62 commit a124096
File tree
29 files changed
+5053
-659
lines changed- docs/features
- dotnet/src
- Generated
- go
- internal/e2e
- testharness
- rpc
- samples
- nodejs
- samples
- src/generated
- python
- copilot/generated
- e2e
- scripts/codegen
- test
- harness
- scenarios/prompts/attachments
29 files changed
+5053
-659
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
0 commit comments