diff --git a/VERSION b/VERSION index 7486fdb..f38fc53 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.2 +0.7.3 diff --git a/cmd/nomos/agent.go b/cmd/nomos/agent.go index b83ecee..7eeccd3 100644 --- a/cmd/nomos/agent.go +++ b/cmd/nomos/agent.go @@ -296,6 +296,15 @@ func (a *agent) chatWith(ctx context.Context, sessionID, message, systemInject s if ok { granted = append(granted, p.execID) slog.Info("nomos: chat-assent granted", "execution", p.execID, "status", status, "session", sessionID) + // Mark as continued so the continuation worker doesn't + // pick up this execution and call resumeSession while the + // chat handler is still processing "go ahead." Without this, + // two LLM calls run concurrently for the same session — + // the chat handler's chat() and the worker's resumeSession() + // — causing empty responses and race conditions. + if execUUID, perr := uuid.Parse(p.execID); perr == nil { + a.store.markContinued(ctx, execUUID) + } emit(agentEvent{Type: "tool_use", Data: map[string]any{"name": "chat_assent", "args": map[string]any{"execution_id": p.execID}, "id": "assent-" + p.execID}, SessionID: sessionID}) emit(agentEvent{Type: "tool_result", Data: map[string]any{"name": "chat_assent", "result": fmt.Sprintf("Approved via chat assent (%q). Status: %s.", message, status), "id": "assent-" + p.execID}, SessionID: sessionID})