Skip to content

Commit aeae1b1

Browse files
committed
chore: refactor names
1 parent dcd146f commit aeae1b1

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

lib/httpapi/server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ func NewServer(ctx context.Context, config ServerConfig) (*Server, error) {
239239
GetTime: func() time.Time {
240240
return time.Now()
241241
},
242-
SnapshotInterval: snapshotInterval,
243-
ScreenStabilityLength: 2 * time.Second,
244-
FormatMessage: formatMessage,
245-
IsAgentReadyForInitialPrompt: isAgentReadyForInitialPrompt,
242+
SnapshotInterval: snapshotInterval,
243+
ScreenStabilityLength: 2 * time.Second,
244+
FormatMessage: formatMessage,
245+
ReadyForInitialPrompt: isAgentReadyForInitialPrompt,
246246
}, config.InitialPrompt)
247247
emitter := NewEventEmitter(1024)
248248

lib/msgfmt/agent_readiness_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import (
99

1010
func TestIsAgentReadyForInitialPrompt(t *testing.T) {
1111
dir := "testdata/initialization"
12-
agentTypes := []AgentType{AgentTypeClaude, AgentTypeGoose, AgentTypeAider, AgentTypeGemini, AgentTypeCopilot, AgentTypeAmp, AgentTypeCodex, AgentTypeCursor, AgentTypeAuggie, AgentTypeAmazonQ, AgentTypeOpencode, AgentTypeCustom}
12+
agentTypes := []AgentType{AgentTypeClaude, AgentTypeGoose, AgentTypeAider, AgentTypeGemini, AgentTypeCopilot, AgentTypeAmp, AgentTypeCodex, AgentTypeCursor, AgentTypeAuggie, AgentTypeAmazonQ, AgentTypeOpencode}
1313
for _, agentType := range agentTypes {
1414
t.Run(string(agentType), func(t *testing.T) {
1515
t.Run("ready", func(t *testing.T) {
1616
cases, err := testdataDir.ReadDir(path.Join(dir, string(agentType), "ready"))
1717
if err != nil {
18-
t.Skipf("failed to read ready cases for agent type %s: %s", agentType, err)
18+
t.Errorf("failed to read ready cases for agent type %s: %s", agentType, err)
1919
}
2020
if len(cases) == 0 {
21-
t.Skipf("no ready cases found for agent type %s", agentType)
21+
t.Errorf("no ready cases found for agent type %s", agentType)
2222
}
2323
for _, c := range cases {
2424
if c.IsDir() {
@@ -35,10 +35,10 @@ func TestIsAgentReadyForInitialPrompt(t *testing.T) {
3535
t.Run("not_ready", func(t *testing.T) {
3636
cases, err := testdataDir.ReadDir(path.Join(dir, string(agentType), "not_ready"))
3737
if err != nil {
38-
t.Skipf("failed to read not_ready cases for agent type %s: %s", agentType, err)
38+
t.Errorf("failed to read not_ready cases for agent type %s: %s", agentType, err)
3939
}
4040
if len(cases) == 0 {
41-
t.Skipf("no not_ready cases found for agent type %s", agentType)
41+
t.Errorf("no not_ready cases found for agent type %s", agentType)
4242
}
4343
for _, c := range cases {
4444
if c.IsDir() {

lib/screentracker/conversation.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ type ConversationConfig struct {
4141
// SkipSendMessageStatusCheck skips the check for whether the message can be sent.
4242
// This is used in tests
4343
SkipSendMessageStatusCheck bool
44-
// IsAgentReadyForInitialPrompt detects whether the agent has initialized and is ready to accept the initial prompt
45-
IsAgentReadyForInitialPrompt func(message string) bool
44+
// ReadyForInitialPrompt detects whether the agent has initialized and is ready to accept the initial prompt
45+
ReadyForInitialPrompt func(message string) bool
4646
}
4747

4848
type ConversationRole string
@@ -80,8 +80,8 @@ type Conversation struct {
8080
InitialPrompt string
8181
// InitialPromptSent keeps track if the InitialPrompt has been successfully sent to the agents
8282
InitialPromptSent bool
83-
// AgentReadyForInitialPrompt keeps track if the agent is ready to accept the initial prompt
84-
AgentReadyForInitialPrompt bool
83+
// ReadyForInitialPrompt keeps track if the agent is ready to accept the initial prompt
84+
ReadyForInitialPrompt bool
8585
}
8686

8787
type ConversationStatus string
@@ -406,9 +406,9 @@ func (c *Conversation) statusInner() ConversationStatus {
406406
}
407407
}
408408

409-
if !c.InitialPromptSent && !c.AgentReadyForInitialPrompt {
410-
if len(snapshots) > 0 && c.cfg.IsAgentReadyForInitialPrompt(snapshots[len(snapshots)-1].screen) {
411-
c.AgentReadyForInitialPrompt = true
409+
if !c.InitialPromptSent && !c.ReadyForInitialPrompt {
410+
if len(snapshots) > 0 && c.cfg.ReadyForInitialPrompt(snapshots[len(snapshots)-1].screen) {
411+
c.ReadyForInitialPrompt = true
412412
return ConversationStatusStable
413413
}
414414
return ConversationStatusChanging

lib/screentracker/conversation_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func TestInitialPromptReadiness(t *testing.T) {
418418
SnapshotInterval: 1 * time.Second,
419419
ScreenStabilityLength: 2 * time.Second,
420420
AgentIO: &testAgent{screen: "loading..."},
421-
IsAgentReadyForInitialPrompt: func(message string) bool {
421+
ReadyForInitialPrompt: func(message string) bool {
422422
return message == "ready"
423423
},
424424
}
@@ -431,7 +431,7 @@ func TestInitialPromptReadiness(t *testing.T) {
431431

432432
// Even though screen is stable, status should be changing because agent is not ready
433433
assert.Equal(t, changing, c.Status())
434-
assert.False(t, c.AgentReadyForInitialPrompt)
434+
assert.False(t, c.ReadyForInitialPrompt)
435435
assert.False(t, c.InitialPromptSent)
436436
})
437437

@@ -441,7 +441,7 @@ func TestInitialPromptReadiness(t *testing.T) {
441441
SnapshotInterval: 1 * time.Second,
442442
ScreenStabilityLength: 2 * time.Second,
443443
AgentIO: &testAgent{screen: "loading..."},
444-
IsAgentReadyForInitialPrompt: func(message string) bool {
444+
ReadyForInitialPrompt: func(message string) bool {
445445
return message == "ready"
446446
},
447447
}
@@ -458,7 +458,7 @@ func TestInitialPromptReadiness(t *testing.T) {
458458
c.AddSnapshot("ready")
459459
c.AddSnapshot("ready")
460460
assert.Equal(t, stable, c.Status())
461-
assert.True(t, c.AgentReadyForInitialPrompt)
461+
assert.True(t, c.ReadyForInitialPrompt)
462462
assert.False(t, c.InitialPromptSent)
463463
})
464464

@@ -468,7 +468,7 @@ func TestInitialPromptReadiness(t *testing.T) {
468468
SnapshotInterval: 1 * time.Second,
469469
ScreenStabilityLength: 2 * time.Second,
470470
AgentIO: &testAgent{screen: "loading..."},
471-
IsAgentReadyForInitialPrompt: func(message string) bool {
471+
ReadyForInitialPrompt: func(message string) bool {
472472
return false // Agent never ready
473473
},
474474
}
@@ -481,7 +481,7 @@ func TestInitialPromptReadiness(t *testing.T) {
481481

482482
// Status should be stable because no initial prompt to wait for
483483
assert.Equal(t, stable, c.Status())
484-
assert.False(t, c.AgentReadyForInitialPrompt)
484+
assert.False(t, c.ReadyForInitialPrompt)
485485
assert.True(t, c.InitialPromptSent) // Set to true when initial prompt is empty
486486
})
487487

@@ -491,7 +491,7 @@ func TestInitialPromptReadiness(t *testing.T) {
491491
SnapshotInterval: 1 * time.Second,
492492
ScreenStabilityLength: 2 * time.Second,
493493
AgentIO: &testAgent{screen: "processing..."},
494-
IsAgentReadyForInitialPrompt: func(message string) bool {
494+
ReadyForInitialPrompt: func(message string) bool {
495495
return false // Agent never ready
496496
},
497497
}
@@ -505,7 +505,7 @@ func TestInitialPromptReadiness(t *testing.T) {
505505

506506
// Status should be stable because initial prompt was already sent
507507
assert.Equal(t, stable, c.Status())
508-
assert.False(t, c.AgentReadyForInitialPrompt)
508+
assert.False(t, c.ReadyForInitialPrompt)
509509
assert.True(t, c.InitialPromptSent)
510510
})
511511

@@ -515,7 +515,7 @@ func TestInitialPromptReadiness(t *testing.T) {
515515
SnapshotInterval: 1 * time.Second,
516516
ScreenStabilityLength: 2 * time.Second,
517517
AgentIO: &testAgent{screen: "ready"},
518-
IsAgentReadyForInitialPrompt: func(message string) bool {
518+
ReadyForInitialPrompt: func(message string) bool {
519519
return message == "ready"
520520
},
521521
}
@@ -526,20 +526,20 @@ func TestInitialPromptReadiness(t *testing.T) {
526526
c.AddSnapshot("ready")
527527
c.AddSnapshot("ready")
528528
assert.Equal(t, stable, c.Status())
529-
assert.True(t, c.AgentReadyForInitialPrompt)
529+
assert.True(t, c.ReadyForInitialPrompt)
530530

531531
// After agent is detected as ready, normal status logic applies
532532
// Screen changes should cause changing status
533533
c.AddSnapshot("changing")
534534
assert.Equal(t, changing, c.Status())
535-
assert.True(t, c.AgentReadyForInitialPrompt)
535+
assert.True(t, c.ReadyForInitialPrompt)
536536

537537
// Once screen stabilizes again, status should be stable
538-
// AgentReadyForInitialPrompt remains true
538+
// ReadyForInitialPrompt remains true
539539
c.AddSnapshot("stable now")
540540
c.AddSnapshot("stable now")
541541
c.AddSnapshot("stable now")
542542
assert.Equal(t, stable, c.Status())
543-
assert.True(t, c.AgentReadyForInitialPrompt)
543+
assert.True(t, c.ReadyForInitialPrompt)
544544
})
545545
}

0 commit comments

Comments
 (0)