mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-30 09:32:45 +01:00
Return persisted planning acceptance or refusal inside the investigation turn. Keep model judgment separate from action authority and preserve accepted action identity across provider failures. Enforce actor/request idempotency atomically and retain complete approval and independent verification context. Preserve unknown disk evidence, stream whitespace and historical resolution timestamps. Keep conversation scrolling inside its own panel. Record real-model, disposable-lab and browser qualification with explicit population limits. Refs #1782
19 lines
555 B
Go
19 lines
555 B
Go
package chat
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/ai/tools"
|
|
)
|
|
|
|
func withRunInvocationIdentity(ctx context.Context, sessionID string, messages []Message) context.Context {
|
|
for i := len(messages) - 1; i >= 0; i-- {
|
|
if messages[i].Role == "user" && messages[i].ID != "" {
|
|
return tools.WithInvocationScope(ctx, sessionID, messages[i].ID)
|
|
}
|
|
}
|
|
// An unpersisted internal run still has one scope for all provider retries.
|
|
return tools.WithInvocationScope(ctx, sessionID, uuid.NewString())
|
|
}
|