-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ui): restore green build (monaco 0.55 pin + dead css import) #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e2b383c
511e255
a6a3f17
b54c480
959d24f
0534196
5c74632
3f17d91
b47aec4
0148874
ad35630
1d83591
958726e
ec341b0
2a11077
99c5ece
11188bf
87206dd
eb82f60
763b623
f94187e
04031d2
09c1998
7f31103
59e274f
a87e498
61e3e89
e1156fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,12 @@ import type { AcpConfigState, AcpAgentDiagnostics, AcpDebugRequest, AcpDebugRunR | |
|
|
||
| const ACP_PROVIDER_ID = "acp"; | ||
|
|
||
| const normalizePlanStatus = (status: unknown): "pending" | "in_progress" | "completed" => { | ||
| if (status === "completed" || status === "done") return "completed"; | ||
| if (status === "in_progress") return "in_progress"; | ||
| return "pending"; | ||
| }; | ||
|
|
||
| type PendingAcpPermission = { | ||
| sessionId: string; | ||
| toolCallId: string; | ||
|
|
@@ -47,7 +53,16 @@ type PendingAcpPermission = { | |
| */ | ||
| export class AcpProviderExecutionPort implements ProviderExecutionPort { | ||
| private runtimePromise: Promise<AcpRuntime> | null = null; | ||
| private activeTurns = new Map<string, { controller: AbortController; eventId: string; runId: string }>(); | ||
| private activeTurns = new Map< | ||
| string, | ||
| { | ||
| controller: AbortController; | ||
| eventId: string; | ||
| runId: string; | ||
| donePromise: Promise<void>; | ||
| doneResolve: () => void; | ||
| } | ||
| >(); | ||
| private pendingPermissions = new Map<string, PendingAcpPermission>(); | ||
| private readonly contentMapper = new AcpContentMapper(); | ||
|
|
||
|
|
@@ -138,10 +153,16 @@ export class AcpProviderExecutionPort implements ProviderExecutionPort { | |
| const runtime = await this.getRuntime(); | ||
| const record = await this.getSessionRecord(sessionId); | ||
| const controller = new AbortController(); | ||
| let doneResolve!: () => void; | ||
| const donePromise = new Promise<void>((resolve) => { | ||
| doneResolve = resolve; | ||
| }); | ||
| this.activeTurns.set(sessionId, { | ||
| controller, | ||
| eventId: assistantMessageId, | ||
| runId: requestId, | ||
| donePromise, | ||
| doneResolve, | ||
| }); | ||
|
|
||
| void this.runTurn( | ||
|
|
@@ -154,7 +175,11 @@ export class AcpProviderExecutionPort implements ProviderExecutionPort { | |
| assistantMessageId, | ||
| record?.workdir, | ||
| ).finally(() => { | ||
| this.activeTurns.delete(sessionId); | ||
| const current = this.activeTurns.get(sessionId); | ||
| if (current && current.runId === requestId) { | ||
| this.activeTurns.delete(sessionId); | ||
| } | ||
| doneResolve(); | ||
| }); | ||
|
|
||
| return { requestId, messageId: assistantMessageId }; | ||
|
|
@@ -374,6 +399,7 @@ export class AcpProviderExecutionPort implements ProviderExecutionPort { | |
| workdir?: string, | ||
| ): Promise<void> { | ||
| const blocks: Array<Record<string, unknown>> = []; | ||
| let planRevision = 0; | ||
| try { | ||
| for await (const notification of runtime.runPromptTurn({ | ||
| conversationId: sessionId, | ||
|
|
@@ -385,8 +411,26 @@ export class AcpProviderExecutionPort implements ProviderExecutionPort { | |
| if (controller.signal.aborted) break; | ||
|
|
||
| const mapped = this.contentMapper.map(notification); | ||
|
|
||
| if (mapped.planEntries && mapped.planEntries.length > 0) { | ||
| planRevision += 1; | ||
| const plan = mapped.planEntries | ||
| .map((entry) => ({ step: (entry.content ?? "").trim(), status: normalizePlanStatus(entry.status) })) | ||
| .filter((item) => item.step.length > 0); | ||
| if (plan.length > 0) { | ||
| this.eventPublisher.publish("chat.plan.updated", { | ||
| sessionId, | ||
| messageId: assistantMessageId, | ||
| plan, | ||
| revision: planRevision, | ||
| updatedAt: new Date().toISOString(), | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| const now = Date.now(); | ||
| for (const block of mapped.blocks) { | ||
| if (block.type === "plan") continue; | ||
| const last = blocks.at(-1); | ||
| if (block.type === "content" && last?.type === "content") { | ||
| last.content = `${last.content ?? ""}${block.content ?? ""}`; | ||
|
|
@@ -498,9 +542,43 @@ export class AcpProviderExecutionPort implements ProviderExecutionPort { | |
| }); | ||
| } | ||
|
|
||
| async steerActiveTurn(_sessionId: string, _content: string | SendMessageInput): Promise<void> { | ||
| await this.cancelGeneration(_sessionId); | ||
| await this.sendMessage(_sessionId, _content); | ||
| async steerActiveTurn(sessionId: string, content: string | SendMessageInput): Promise<void> { | ||
| await this.interruptActiveTurn(sessionId); | ||
| await this.sendMessage(sessionId, content); | ||
| } | ||
|
|
||
| /** | ||
| * Non-destructively interrupts the in-flight ACP prompt for a session so a new | ||
| * turn can follow (used by steer). Unlike {@link cancelGeneration}, this does | ||
| * NOT tear down the session or unbind the agent process: it asks the agent to | ||
| * cancel the active `session/prompt` request, aborts local streaming, and | ||
| * waits for the turn to settle before returning. | ||
| */ | ||
| private async interruptActiveTurn(sessionId: string): Promise<void> { | ||
| const active = this.activeTurns.get(sessionId); | ||
| if (!active) return; | ||
|
|
||
| active.controller.abort(); | ||
|
|
||
| for (const [toolCallId, pending] of this.pendingPermissions) { | ||
| if (pending.sessionId !== sessionId) continue; | ||
| this.pendingPermissions.delete(toolCallId); | ||
| pending.resolve({ outcome: { outcome: "cancelled" } }); | ||
| } | ||
|
|
||
| try { | ||
| const runtime = await this.getRuntime(); | ||
| const session = runtime.sessionManager.getSession(sessionId); | ||
| if (session) { | ||
| await session.connection.agent.notify(acpMethods.agent.session.cancel, { | ||
| sessionId: session.sessionId, | ||
| } as schema.CancelNotification); | ||
| } | ||
| } catch (error) { | ||
| console.warn("[ACP] Failed to send session/cancel for steer:", error); | ||
| } | ||
|
|
||
| await Promise.race([active.donePromise, new Promise<void>((resolve) => setTimeout(resolve, 4000))]).catch(() => {}); | ||
|
Comment on lines
+569
to
+581
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE="apps/daemon/src/host/acp-provider-execution.ts"
if [ -f "$FILE" ]; then
echo "FILE_EXISTS yes"
wc -l "$FILE"
sed -n '520,590p' "$FILE"
else
echo "FILE_EXISTS no"
fd -a 'acp-provider-execution.ts' .
fi
echo "--- nearby symbols ---"
rg -n "steerActiveTurn|async [^(]*steerActiveTurn|active\.donePromise|agent\.session\.cancel|notify\\(" apps/daemon/src/host/acp-provider-execution.tsRepository: dvaJi/argos Length of output: 3007 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE="apps/daemon/src/host/acp-provider-execution.ts"
echo "--- definitions ---"
rg -n "activeTurns|activeTurn|donePromise|controller|class .*Execution|interface .*Execution|type .*Execution|cancelGeneration|sendMessage\\(" "$FILE"
echo "--- surrounding implementation ---"
sed -n '1,190p' "$FILE"
sed -n '590,785p' "$FILE"Repository: dvaJi/argos Length of output: 16263 Apply the timeout before waiting on runtime access and the cancel request.
🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| async getAcpSessionCommands(conversationId: string): Promise< | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.