Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1006b98

Browse files
committed
fix: accept initial watcher status
We are discarding all "working" updates from the screen watcher thatdoes not include a new user message, but it makes sense to accept thevery first message, because the agent could be working but neglected toreport that fact.
1 parente03d132 commit1006b98

File tree

2 files changed

+259
-211
lines changed

2 files changed

+259
-211
lines changed

‎cli/exp_mcp.go

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -399,18 +399,25 @@ func (r *RootCmd) mcpServer() *serpent.Command {
399399
// new user message, and the status is "working" and not self-reported
400400
// (meaning it came from the screen watcher), then it means one of two
401401
// things:
402-
// 1. The AI agent is still working, so there is nothing to update.
403-
// 2. The AI agent stopped working, then the user has interacted with
404-
// the terminal directly. For now, we are ignoring these updates.
405-
// This risks missing cases where the user manually submits a new
406-
// prompt and the AI agent becomes active and does not update itself,
407-
// but it avoids spamming useless status updates as the user is
408-
// typing, so the tradeoff is worth it. In the future, if we can
409-
// reliably distinguish between user and AI agent activity, we can
410-
// change this.
402+
//
403+
// 1. The AI agent is not working; the user is interacting with the
404+
// terminal directly.
405+
// 2. The AI agent is working.
406+
//
407+
// At the moment, we have no way to tell the difference between these
408+
// two states. In the future, if we can reliably distinguish between
409+
// user and AI agent activity, we can change this.
410+
//
411+
// If this is our first update, we assume it is the AI agent working and
412+
// accept the update.
413+
//
414+
// Otherwise we discard the update. This risks missing cases where the
415+
// user manually submits a new prompt and the AI agent becomes active
416+
// (and does not update itself), but it avoids spamming useless status
417+
// updates as the user is typing, so the tradeoff is worth it.
411418
ifreport.messageID>lastUserMessageID {
412419
report.state=codersdk.WorkspaceAppStatusStateWorking
413-
}elseifreport.state==codersdk.WorkspaceAppStatusStateWorking&&!report.selfReported {
420+
}elseifreport.state==codersdk.WorkspaceAppStatusStateWorking&&!report.selfReported&&lastReport.state!=""{
414421
returnreport,false
415422
}
416423
// Preserve previous message and URI if there was no message.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp