(t *testing.T)
| 418 | } |
| 419 | |
| 420 | func Test_InitialPrompt_SentOnStart(t *testing.T) { |
| 421 | mClock := quartz.NewMock(t) |
| 422 | mock := newMockAgentIO() |
| 423 | // Set up blocking to synchronize with the initial prompt send |
| 424 | started, done := mock.BlockWrite() |
| 425 | |
| 426 | initialPrompt := []screentracker.MessagePart{ |
| 427 | screentracker.MessagePartText{Content: "initial prompt"}, |
| 428 | } |
| 429 | |
| 430 | conv := acpio.NewACPConversation(context.Background(), mock, nil, initialPrompt, nil, mClock) |
| 431 | conv.Start(context.Background()) |
| 432 | |
| 433 | // Wait for write to start (initial prompt is being sent via Start's goroutine) |
| 434 | <-started |
| 435 | |
| 436 | // Should have user message from initial prompt |
| 437 | messages := conv.Messages() |
| 438 | require.GreaterOrEqual(t, len(messages), 1) |
| 439 | assert.Equal(t, screentracker.ConversationRoleUser, messages[0].Role) |
| 440 | assert.Equal(t, "initial prompt", messages[0].Message) |
| 441 | |
| 442 | // Signal a chunk so executePrompt's timer wait doesn't hang on the mock clock. |
| 443 | mock.SimulateChunks("initial response") |
| 444 | |
| 445 | // Unblock the write to let the test complete cleanly |
| 446 | close(done) |
| 447 | } |
| 448 | |
| 449 | func Test_Messages_AreCopied(t *testing.T) { |
| 450 | mClock := quartz.NewMock(t) |
nothing calls this directly
no test coverage detected