From de6a04bf9c1d60d963e8b7cbe69eb2498d3aba31 Mon Sep 17 00:00:00 2001 From: SHINE-six Date: Sat, 14 Mar 2026 19:35:23 +0800 Subject: [PATCH] refactor(tests): improve comments for clarity in ChannelFiltering test case --- pkg/tools/spawn_status_test.go | 6 +++++- pkg/tools/subagent.go | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/tools/spawn_status_test.go b/pkg/tools/spawn_status_test.go index 89e6bfe3a..fcd3c4a36 100644 --- a/pkg/tools/spawn_status_test.go +++ b/pkg/tools/spawn_status_test.go @@ -384,7 +384,11 @@ func TestSpawnStatusTool_ChannelFiltering_NoContext(t *testing.T) { tool := NewSpawnStatusTool(manager) - // No tool context (e.g. CLI) — callerChannel and callerChatID are both "". + // No ToolContext injected (e.g. a direct programmatic call that bypasses + // WithToolContext entirely) — callerChannel and callerChatID are both "". + // Note: the normal CLI path uses ProcessDirectWithChannel("cli", "direct"), + // which *does* inject a non-empty context; this test covers the case where + // no context injection happens at all. // The filter conditions require a non-empty caller value, so all tasks pass through. result := tool.Execute(context.Background(), map[string]any{}) if result.IsError { diff --git a/pkg/tools/subagent.go b/pkg/tools/subagent.go index fc13c0f09..40c9e6ae9 100644 --- a/pkg/tools/subagent.go +++ b/pkg/tools/subagent.go @@ -111,7 +111,6 @@ func (sm *SubagentManager) Spawn( func (sm *SubagentManager) runTask(ctx context.Context, task *SubagentTask, callback AsyncCallback) { sm.mu.Lock() task.Status = "running" - task.Created = time.Now().UnixMilli() sm.mu.Unlock() // Build system prompt for subagent