Commit 605da96
SDK: add includeCurrentDatetime flag to suppress datetime injection
Adds an opt-in `includeCurrentDatetime?: boolean` session/resume option
across all language bindings (Node, Python, Go, .NET, Rust, Java). When
`false`, the SDK forwards `includeCurrentDatetime: false` to the runtime,
which suppresses the injected `<current_datetime>` tag on model-facing
user messages. Defaults to true for backwards compatibility.
This is the SDK-side counterpart to copilot-agent-runtime PR
github/copilot-agent-runtime#8130, which is what actually does the
suppression work in the runtime. The combination is needed when short
prompts (e.g. session-name summarisation) are confused by datetime
context, or when the user's own prompt contains a date/time that
collides with the injected tag.
Surface added per language:
- Node: `SessionConfigBase.includeCurrentDatetime?: boolean`
- Python: `create_session(..., include_current_datetime=...)` and
`resume_session(..., include_current_datetime=...)`
- Go: `SessionConfig.IncludeCurrentDatetime` /
`ResumeSessionConfig.IncludeCurrentDatetime` (*bool)
- .NET: `SessionConfigBase.IncludeCurrentDatetime` (bool?)
- Rust: `SessionConfig.include_current_datetime` /
`ResumeSessionConfig.include_current_datetime` plus
`with_include_current_datetime` builder + wire fields
- Java: `SessionConfig.includeCurrentDatetime` /
`ResumeSessionConfig.includeCurrentDatetime` plus
`SessionRequestBuilder.includeCurrentDatetime`, wire fields,
and clone/jackson/builder unit tests
The wire field name is `includeCurrentDatetime` everywhere, matching
the runtime PR's request schema.
Verified locally with CONTRIBUTING.md test commands:
- nodejs: `npm test` 416 / 7 skipped; `npm run lint` 0 errors
- python: unit 145, ruff clean, e2e 283 / 7 pre-existing auth fails / 6
skipped (failures unrelated to this change)
- go: `go test ./...` all pass; `golangci-lint run` 1 pre-existing
govet in `definetool.go:210`
- dotnet: `dotnet test` 463 / 2 skipped
- rust: `cargo test --features test-support` all + 18 doctests pass
- java: custom E2E driver against gpt-5.2 (Halcyonhal9/lumi2 fork)
Refs: github/copilot-agent-runtime#8130
Co-authored-by: Copilot <[email protected]>1 parent a77e8ec commit 605da96
17 files changed
Lines changed: 373 additions & 5 deletions
File tree
- dotnet/src
- go
- java/src
- main/java/com/github/copilot/sdk
- json
- test/java/com/github/copilot/sdk
- nodejs/src
- python/copilot
- rust/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
| 621 | + | |
| 622 | + | |
622 | 623 | | |
623 | 624 | | |
624 | 625 | | |
| |||
778 | 779 | | |
779 | 780 | | |
780 | 781 | | |
781 | | - | |
| 782 | + | |
| 783 | + | |
782 | 784 | | |
783 | 785 | | |
784 | 786 | | |
| |||
1866 | 1868 | | |
1867 | 1869 | | |
1868 | 1870 | | |
1869 | | - | |
| 1871 | + | |
| 1872 | + | |
1870 | 1873 | | |
1871 | 1874 | | |
1872 | 1875 | | |
| |||
1928 | 1931 | | |
1929 | 1932 | | |
1930 | 1933 | | |
1931 | | - | |
| 1934 | + | |
| 1935 | + | |
1932 | 1936 | | |
1933 | 1937 | | |
1934 | 1938 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2214 | 2214 | | |
2215 | 2215 | | |
2216 | 2216 | | |
| 2217 | + | |
2217 | 2218 | | |
2218 | 2219 | | |
2219 | 2220 | | |
| |||
2292 | 2293 | | |
2293 | 2294 | | |
2294 | 2295 | | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
2295 | 2302 | | |
2296 | 2303 | | |
2297 | 2304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
| 615 | + | |
615 | 616 | | |
616 | 617 | | |
617 | 618 | | |
| |||
796 | 797 | | |
797 | 798 | | |
798 | 799 | | |
| 800 | + | |
799 | 801 | | |
800 | 802 | | |
801 | 803 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
873 | 877 | | |
874 | 878 | | |
875 | 879 | | |
| |||
1084 | 1088 | | |
1085 | 1089 | | |
1086 | 1090 | | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1087 | 1095 | | |
1088 | 1096 | | |
1089 | 1097 | | |
| |||
1374 | 1382 | | |
1375 | 1383 | | |
1376 | 1384 | | |
| 1385 | + | |
1377 | 1386 | | |
1378 | 1387 | | |
1379 | 1388 | | |
| |||
1428 | 1437 | | |
1429 | 1438 | | |
1430 | 1439 | | |
| 1440 | + | |
1431 | 1441 | | |
1432 | 1442 | | |
1433 | 1443 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| 207 | + | |
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
241 | 244 | | |
242 | 245 | | |
243 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
244 | 266 | | |
245 | 267 | | |
246 | 268 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
282 | 323 | | |
283 | 324 | | |
284 | 325 | | |
| |||
937 | 978 | | |
938 | 979 | | |
939 | 980 | | |
| 981 | + | |
940 | 982 | | |
941 | 983 | | |
942 | 984 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
245 | 248 | | |
246 | 249 | | |
247 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
248 | 270 | | |
249 | 271 | | |
250 | 272 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
337 | 378 | | |
338 | 379 | | |
339 | 380 | | |
| |||
1033 | 1074 | | |
1034 | 1075 | | |
1035 | 1076 | | |
| 1077 | + | |
1036 | 1078 | | |
1037 | 1079 | | |
1038 | 1080 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
218 | 237 | | |
219 | 238 | | |
220 | 239 | | |
| |||
234 | 253 | | |
235 | 254 | | |
236 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
237 | 275 | | |
238 | 276 | | |
239 | 277 | | |
| |||
0 commit comments