Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go/internal/e2e/builtin_tools_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ func assistantContent(t *testing.T, event *copilot.SessionEvent) string {

if event == nil {
t.Fatal("Expected assistant message, got nil")
return ""
}
data, ok := event.Data.(*copilot.AssistantMessageData)
if !ok {
Expand Down
1 change: 1 addition & 0 deletions go/internal/e2e/client_options_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ func TestClientOptionsE2E(t *testing.T) {
}
if createReq == nil {
t.Fatalf("session.create request was not captured. Captured requests: %+v", updated.Requests)
return
}
params, ok := createReq.Params.(map[string]any)
if !ok {
Expand Down
3 changes: 3 additions & 0 deletions go/internal/e2e/event_fidelity_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestEventFidelityE2E(t *testing.T) {

if usageEvent == nil {
t.Fatalf("Expected at least one assistant.usage event; events=%v", eventFidelityTypes(snapshot))
return
}
if usageEvent.Model == "" {
t.Errorf("Expected assistant.usage event to have a non-empty model field, got %#v", usageEvent)
Expand Down Expand Up @@ -110,6 +111,7 @@ func TestEventFidelityE2E(t *testing.T) {

if usageInfo == nil {
t.Fatalf("Expected at least one session.usage_info event; events=%v", eventFidelityTypes(snapshot))
return
}
if usageInfo.CurrentTokens <= 0 {
t.Errorf("Expected session.usage_info.currentTokens > 0, got %v", usageInfo.CurrentTokens)
Expand Down Expand Up @@ -460,6 +462,7 @@ func TestEventFidelityE2E(t *testing.T) {
assistantEvent := firstAssistantMessageEventFidelityData(snapshot)
if assistantEvent == nil {
t.Fatalf("Expected at least one assistant.message event; events=%v", eventFidelityTypes(snapshot))
return
}
if assistantEvent.MessageID == "" {
t.Fatalf("Expected assistant.message messageId, got %#v", assistantEvent)
Expand Down
5 changes: 5 additions & 0 deletions go/internal/e2e/multi_client_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ func TestMultiClientE2E(t *testing.T) {
}
if response1 == nil {
t.Fatalf("Expected response with content")
return
}
rd1, ok := response1.Data.(*copilot.AssistantMessageData)
if !ok {
Expand All @@ -394,6 +395,7 @@ func TestMultiClientE2E(t *testing.T) {
}
if response2 == nil {
t.Fatalf("Expected response with content")
return
}
rd2, ok := response2.Data.(*copilot.AssistantMessageData)
if !ok {
Expand Down Expand Up @@ -450,6 +452,7 @@ func TestMultiClientE2E(t *testing.T) {
}
if stableResponse == nil {
t.Fatalf("Expected response with content")
return
}
srd, ok := stableResponse.Data.(*copilot.AssistantMessageData)
if !ok {
Expand All @@ -467,6 +470,7 @@ func TestMultiClientE2E(t *testing.T) {
}
if ephemeralResponse == nil {
t.Fatalf("Expected response with content")
return
}
erd, ok := ephemeralResponse.Data.(*copilot.AssistantMessageData)
if !ok {
Expand Down Expand Up @@ -497,6 +501,7 @@ func TestMultiClientE2E(t *testing.T) {
}
if afterResponse == nil {
t.Fatalf("Expected response with content")
return
}
ard, ok := afterResponse.Data.(*copilot.AssistantMessageData)
if !ok {
Expand Down
2 changes: 2 additions & 0 deletions go/internal/e2e/pending_work_resume_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ func TestPendingWorkResumeE2E(t *testing.T) {
}
if resumeEvent == nil {
t.Fatal("Expected a session.resume event")
return
}
if resumeEvent.ContinuePendingWork == nil || *resumeEvent.ContinuePendingWork != false {
t.Errorf("Expected ContinuePendingWork=false in resume event, got %v", resumeEvent.ContinuePendingWork)
Expand Down Expand Up @@ -634,6 +635,7 @@ func TestPendingWorkResumeE2E(t *testing.T) {
}
if resumeEvent == nil {
t.Fatal("Expected a session.resume event")
return
}
if resumeEvent.ContinuePendingWork == nil || *resumeEvent.ContinuePendingWork != true {
t.Errorf("Expected ContinuePendingWork=true in resume event, got %v", resumeEvent.ContinuePendingWork)
Expand Down
2 changes: 2 additions & 0 deletions go/internal/e2e/rpc_event_side_effects_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func TestRpcEventSideEffectsE2E(t *testing.T) {
userEvent := firstUserMessageEvent(messages)
if userEvent == nil {
t.Fatal("Expected at least one user.message in persisted history")
return
}
targetEventID := userEvent.ID

Expand Down Expand Up @@ -230,6 +231,7 @@ func TestRpcEventSideEffectsE2E(t *testing.T) {
userEvent := firstUserMessageEvent(messages)
if userEvent == nil {
t.Fatal("Expected at least one user.message in persisted history")
return
}

truncateResult, err := session.RPC.History.Truncate(t.Context(), &rpc.HistoryTruncateRequest{EventID: userEvent.ID})
Expand Down
2 changes: 2 additions & 0 deletions go/internal/e2e/rpc_server_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func TestRpcServerE2E(t *testing.T) {
discovered := findServerSkill(skills.Skills, skillName)
if discovered == nil {
t.Fatalf("Expected to discover skill %q", skillName)
return
}
if discovered.Description != "Skill discovered by server-scoped RPC tests." {
t.Errorf("Expected description to match, got %q", discovered.Description)
Expand Down Expand Up @@ -211,6 +212,7 @@ func TestRpcServerE2E(t *testing.T) {
disabledSkill := findServerSkill(disabled.Skills, skillName)
if disabledSkill == nil {
t.Fatalf("Expected to find skill %q after disable", skillName)
return
}
if disabledSkill.Enabled {
t.Errorf("Expected skill %q to be Enabled=false after global disable", skillName)
Expand Down
2 changes: 2 additions & 0 deletions go/internal/e2e/rpc_session_state_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ func TestRpcSessionStateE2E(t *testing.T) {
}
if fork == nil {
t.Fatal("Expected non-nil fork result")
return
}
if strings.TrimSpace(fork.SessionID) == "" {
t.Fatal("Expected non-empty fork session id")
Expand Down Expand Up @@ -379,6 +380,7 @@ func TestRpcSessionStateE2E(t *testing.T) {
}
if secondUserEvent == nil {
t.Fatal("Expected the second user.message in persisted history")
return
}
boundaryEventID := secondUserEvent.ID

Expand Down
3 changes: 3 additions & 0 deletions go/internal/e2e/session_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ func TestSessionE2E(t *testing.T) {

if metadata == nil {
t.Fatal("Expected metadata to be non-nil")
return
}

if metadata.SessionID != session.SessionID {
Expand Down Expand Up @@ -1043,6 +1044,7 @@ func TestSessionE2E(t *testing.T) {

if lastSessionID == nil {
t.Fatal("Expected last session ID to be non-nil")
return
}

if *lastSessionID != session.SessionID {
Expand Down Expand Up @@ -1561,6 +1563,7 @@ func TestSessionMessageOptionsE2E(t *testing.T) {
}
if userMsg == nil {
t.Fatal("No user.message event found")
return
}
if userMsg.Content != "Say mode ok." {
t.Errorf("Expected Content 'Say mode ok.', got %q", userMsg.Content)
Expand Down
1 change: 1 addition & 0 deletions go/internal/e2e/skills_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ func TestSkillsE2E(t *testing.T) {
}
if discovered == nil {
t.Fatalf("Expected to discover skill %q via EnableConfigDiscovery", skillName)
return
}
if !discovered.Enabled {
t.Error("Expected discovered skill to be Enabled=true")
Expand Down
1 change: 1 addition & 0 deletions go/internal/e2e/subagent_hooks_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func TestSubagentHooksE2E(t *testing.T) {
}
if taskPre == nil {
t.Fatal("preToolUse should fire for the parent's 'task' tool call")
return
}

// Sub-agent tool hooks fire for "view"
Expand Down
1 change: 1 addition & 0 deletions go/internal/e2e/tools_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ func TestToolsE2E(t *testing.T) {

if answer == nil {
t.Fatalf("Expected assistant message with content")
return
}
ad, ok := answer.Data.(*copilot.AssistantMessageData)
if !ok {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,29 @@ conversations:
content: modified by hook
- role: assistant
content: 'The echo_value returned: **"modified by hook"**'
- messages:
- role: system
content: ${system}
- role: user
content: Call echo_value with value 'original', then reply with the result.
- role: assistant
content: I'll call echo_value with 'original' for you.
tool_calls:
- id: toolcall_0
type: function
function:
name: report_intent
arguments: '{"intent":"Calling echo_value"}'
- id: toolcall_1
type: function
function:
name: echo_value
arguments: '{"value":"original"}'
- role: tool
tool_call_id: toolcall_0
content: Intent logged
- role: tool
tool_call_id: toolcall_1
content: modified by hook
- role: assistant
content: 'The echo_value returned: **"modified by hook"**'
Loading