test: stabilize local session lifecycle timing

This commit is contained in:
kory
2026-10-02 14:35:32 +08:00
parent 650dc7186e
commit 5551f69b17
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ func TestProcessSessionLocalSnakeCaseAndLifecycle(t *testing.T) {
if w.Code != http.StatusOK { if w.Code != http.StatusOK {
t.Fatalf("start status=%d body=%s", w.Code, w.Body.String()) t.Fatalf("start status=%d body=%s", w.Code, w.Body.String())
} }
time.Sleep(400 * time.Millisecond) time.Sleep(1 * time.Second)
req = httptest.NewRequest(http.MethodPost, "/api/v1/process/session?action=read", strings.NewReader(`{"device":"local","session_id":"session-test-001"}`)) req = httptest.NewRequest(http.MethodPost, "/api/v1/process/session?action=read", strings.NewReader(`{"device":"local","session_id":"session-test-001"}`))
w = httptest.NewRecorder() w = httptest.NewRecorder()
s.processSession(w, req) s.processSession(w, req)
+1 -1
View File
@@ -32,7 +32,7 @@ var registry = map[string]ToolSpec{
var actionTools = map[string]string{ var actionTools = map[string]string{
"read": "read_file", "probe": "read_file", "write": "write_file", "read": "read_file", "probe": "read_file", "write": "write_file",
"mcp": "mcp_call", "exec": "exec_command", "mcp": "mcp_call", "exec": "exec_command", "diagnostic": "diagnostic_command",
} }
func Lookup(name string) (ToolSpec, bool) { func Lookup(name string) (ToolSpec, bool) {