Pulse/internal
rcourtman 43760fb0d0 Patrol runs are now stateless — drop prior session history
Patrol's "patrol-main" session was reused across every
scheduled run, so ExecutePatrolStream loaded the full
session history into the agentic loop's input. When any
prior run ended after the model emitted tool_calls but
before all tool results landed (provider error, timeout,
context cancellation), the orphan tool_calls were persisted
and every subsequent run inherited them. The provider then
rejected the conversation with:

  An assistant message with 'tool_calls' must be followed
  by tool messages responding to each 'tool_call_id'.
  (insufficient tool messages following tool_calls message)

Patrol failed 271 consecutive runs with this error before
it was diagnosed. Each new run added another user prompt
on top of the broken structure, so the message slice grew
to 33+ messages with one assistant turn at position 23
holding 4 orphan tool_call_ids and 9 user prompts stacked
after it.

The "patrol runs need a clean slate" comment at line 1898
documents that the knowledge accumulator is freshened per
run; the conversation history was the matching gap.
ExecutePatrolStream now passes only this run's user prompt
to the agentic loop. The session is still written to for
audit/forensics, just no longer fed back into the model.

Live verified: Patrol now completes successfully (18 tool
calls, 3m23s) on a session that previously failed every
run with the malformed-history error. The runtime-failure
finding auto-resolved on this same successful run.

Adds a classifier bucket for "insufficient tool messages"
errors so any future regression in this area surfaces with
a meaningful diagnostic instead of the generic
"Provider analysis error" fallback. New
PatrolFailureCauseMalformedToolHistory cause; predicate
patrolMalformedToolHistory matches DeepSeek's exact phrasing
and OpenAI's similar variants.

ai-runtime contract updated.
2026-05-10 17:14:47 +01:00
..
actionplanner
agentexec
agenttls
agentupdate
ai Patrol runs are now stateless — drop prior session history 2026-05-10 17:14:47 +01:00
alerts
api Surface cached preflight in Patrol tools readiness check 2026-05-10 16:41:16 +01:00
bootstrap
cloudcp
config Keep direct DeepSeek Patrol models selectable 2026-05-08 11:57:04 +01:00
crypto
deploy
discovery
dockeragent
hostagent Fix PVE version detection on agent hosts 2026-05-08 15:30:08 +01:00
hosted
hostmetrics
kubernetesagent
license
logging
metrics
mock Drive agent host profiles from platform manifest 2026-05-07 23:42:15 +01:00
mockmode
mockmodel
mockruntime
models Fix platform identity source contracts 2026-05-08 14:54:08 +01:00
monitoring Mark failed PBS poll as failure and lock down with regression tests 2026-05-08 19:53:03 +01:00
notifications
platformsupport Show platform versions in system badges 2026-05-08 15:07:09 +01:00
recovery
relay
remoteconfig
repoctl
securityutil
sensors
servicediscovery
ssh/knownhosts
storagehealth Fix Unraid storage health explanations 2026-05-08 12:18:09 +01:00
system
telemetry
testutil
truenas
unifiedresources Merge duplicate map keys in TestActionExecutionContractStaysAPIOwned 2026-05-09 15:08:51 +01:00
updates Verify SSHSIG on in-app update artifacts 2026-05-09 23:14:07 +01:00
updatesignature
utils
vmware
websocket