We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bca5291 commit 66c5b74Copy full SHA for 66c5b74
src/examples/agent.ts
@@ -30,7 +30,9 @@ class ExampleAgent implements acp.Agent {
30
async newSession(
31
_params: acp.NewSessionRequest,
32
): Promise<acp.NewSessionResponse> {
33
- const sessionId = Math.random().toString(36).substring(2);
+ const sessionId = Array.from(crypto.getRandomValues(new Uint8Array(16)))
34
+ .map((b) => b.toString(16).padStart(2, "0"))
35
+ .join("");
36
37
this.sessions.set(sessionId, {
38
pendingPrompt: null,
0 commit comments