Skip to content

Commit 5ced40e

Browse files
committed
remove cursor checks - I'm not sure if cursor position changes can reliably indicate that the agent started processing a message
1 parent 2a37165 commit 5ced40e

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

lib/screentracker/conversation.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ type screenSnapshot struct {
2121
type AgentIO interface {
2222
Write(data []byte) (int, error)
2323
ReadScreen() string
24-
Cursor() (int, int)
2524
}
2625

2726
type ConversationConfig struct {
@@ -290,7 +289,6 @@ func (c *Conversation) writeMessageWithConfirmation(ctx context.Context, message
290289

291290
// wait for the screen to change after the carriage return is written
292291
screenBeforeCarriageReturn := c.cfg.AgentIO.ReadScreen()
293-
cursorBeforeCarriageReturnX, cursorBeforeCarriageReturnY := c.cfg.AgentIO.Cursor()
294292
lastCarriageReturnTime := time.Time{}
295293
if err := util.WaitFor(ctx, util.WaitTimeout{
296294
Timeout: 15 * time.Second,
@@ -307,11 +305,8 @@ func (c *Conversation) writeMessageWithConfirmation(ctx context.Context, message
307305
}
308306
time.Sleep(25 * time.Millisecond)
309307
screen := c.cfg.AgentIO.ReadScreen()
310-
cursorX, cursorY := c.cfg.AgentIO.Cursor()
311308

312-
return screen != screenBeforeCarriageReturn ||
313-
cursorX != cursorBeforeCarriageReturnX ||
314-
cursorY != cursorBeforeCarriageReturnY, nil
309+
return screen != screenBeforeCarriageReturn, nil
315310
}); err != nil {
316311
return xerrors.Errorf("failed to wait for processing to start: %w", err)
317312
}

lib/screentracker/conversation_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ func (a *testAgent) ReadScreen() string {
3131
return a.screen
3232
}
3333

34-
func (a *testAgent) Cursor() (int, int) {
35-
return 0, 0
36-
}
37-
3834
func (a *testAgent) Write(data []byte) (int, error) {
3935
return 0, nil
4036
}

lib/termexec/termexec.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ func (p *Process) ReadScreen() string {
7070
return p.xp.State.String()
7171
}
7272

73-
// Cursor returns the current cursor position.
74-
func (p *Process) Cursor() (int, int) {
75-
return p.xp.State.Cursor()
76-
}
77-
7873
// Write sends input to the process via the pseudo terminal.
7974
func (p *Process) Write(data []byte) (int, error) {
8075
return p.xp.TerminalInPipe().Write(data)

0 commit comments

Comments
 (0)