Skip to content

Commit 6d6904f

Browse files
committed
Merge branch 'main' into copilot/review-code-changes
2 parents e43386b + 21a586d commit 6d6904f

6 files changed

Lines changed: 25 additions & 23 deletions

File tree

.github/dependabot.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
version: 2
2+
multi-ecosystem-groups:
3+
all:
4+
schedule:
5+
interval: 'weekly'
26
updates:
37
- package-ecosystem: 'github-actions'
48
directory: '/'
5-
schedule:
6-
interval: 'weekly'
9+
multi-ecosystem-group: 'all'
710
- package-ecosystem: 'devcontainers'
811
directory: '/'
9-
schedule:
10-
interval: 'weekly'
12+
multi-ecosystem-group: 'all'
1113
# Node.js dependencies
1214
- package-ecosystem: 'npm'
1315
directory: '/nodejs'
14-
schedule:
15-
interval: 'weekly'
16+
multi-ecosystem-group: 'all'
1617
- package-ecosystem: 'npm'
1718
directory: '/test/harness'
18-
schedule:
19-
interval: 'weekly'
19+
multi-ecosystem-group: 'all'
2020
# Python dependencies
2121
- package-ecosystem: 'pip'
2222
directory: '/python'
23-
schedule:
24-
interval: 'weekly'
23+
multi-ecosystem-group: 'all'
2524
# Go dependencies
2625
- package-ecosystem: 'gomod'
2726
directory: '/go'
28-
schedule:
29-
interval: 'weekly'
27+
multi-ecosystem-group: 'all'
3028
# .NET dependencies
3129
- package-ecosystem: 'nuget'
3230
directory: '/dotnet'
33-
schedule:
34-
interval: 'weekly'
31+
multi-ecosystem-group: 'all'

dotnet/test/GitHub.Copilot.SDK.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
22+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
2323
<PackageReference Include="xunit" Version="2.9.3" />
2424
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
2525
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

go/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ go run chat.go
2525
package main
2626

2727
import (
28+
"context"
2829
"fmt"
2930
"log"
3031

@@ -285,6 +286,7 @@ Enable streaming to receive assistant response chunks as they're generated:
285286
package main
286287

287288
import (
289+
"context"
288290
"fmt"
289291
"log"
290292

python/copilot/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ async def _execute_tool_call(
15951595
toolTelemetry={},
15961596
)
15971597

1598-
return self._normalize_tool_result(result)
1598+
return self._normalize_tool_result(cast(ToolResult, result))
15991599

16001600
def _normalize_tool_result(self, result: ToolResult) -> ToolResult:
16011601
"""

python/copilot/jsonrpc.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,23 @@ async def stop(self):
104104
self._stderr_thread.join(timeout=1.0)
105105

106106
async def request(
107-
self, method: str, params: Optional[dict] = None, timeout: float = 30.0
107+
self, method: str, params: Optional[dict] = None, timeout: Optional[float] = None
108108
) -> Any:
109109
"""
110110
Send a JSON-RPC request and wait for response
111111
112112
Args:
113113
method: Method name
114114
params: Optional parameters
115-
timeout: Request timeout in seconds (default 30s)
115+
timeout: Optional request timeout in seconds. If None (default),
116+
waits indefinitely for the server to respond.
116117
117118
Returns:
118119
The result from the response
119120
120121
Raises:
121122
JsonRpcError: If server returns an error
122-
asyncio.TimeoutError: If request times out
123+
asyncio.TimeoutError: If request times out (only when timeout is set)
123124
"""
124125
request_id = str(uuid.uuid4())
125126

@@ -141,7 +142,9 @@ async def request(
141142
await self._send_message(message)
142143

143144
try:
144-
return await asyncio.wait_for(future, timeout=timeout)
145+
if timeout is not None:
146+
return await asyncio.wait_for(future, timeout=timeout)
147+
return await future
145148
finally:
146149
with self._pending_lock:
147150
self.pending_requests.pop(request_id, None)

python/copilot/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import asyncio
99
import inspect
1010
import threading
11-
from typing import Any, Callable, Optional
11+
from typing import Any, Callable, Optional, cast
1212

1313
from .generated.rpc import SessionRpc
1414
from .generated.session_events import SessionEvent, SessionEventType, session_event_from_dict
@@ -336,7 +336,7 @@ async def _handle_permission_request(
336336
result = handler(request, {"session_id": self.session_id})
337337
if inspect.isawaitable(result):
338338
result = await result
339-
return result
339+
return cast(PermissionRequestResult, result)
340340
except Exception: # pylint: disable=broad-except
341341
# Handler failed, deny permission
342342
return {"kind": "denied-no-approval-rule-and-could-not-request-from-user"}
@@ -388,7 +388,7 @@ async def _handle_user_input_request(self, request: dict) -> UserInputResponse:
388388
)
389389
if inspect.isawaitable(result):
390390
result = await result
391-
return result
391+
return cast(UserInputResponse, result)
392392
except Exception:
393393
raise
394394

0 commit comments

Comments
 (0)