core: do not add entities to batched agent errors (#6351)

This commit is contained in:
Evgeny
2025-10-10 13:54:19 +01:00
committed by GitHub
parent ad12f840f1
commit e291a71ef3
8 changed files with 35 additions and 39 deletions
+2 -2
View File
@@ -1238,7 +1238,7 @@ data SlowSQLQuery = SlowSQLQuery
data ChatError
= ChatError {errorType :: ChatErrorType}
| ChatErrorAgent {agentError :: AgentErrorType, connectionEntity_ :: Maybe ConnectionEntity}
| ChatErrorAgent {agentError :: AgentErrorType, agentConnId :: AgentConnId, connectionEntity_ :: Maybe ConnectionEntity}
| ChatErrorStore {storeError :: StoreError}
| ChatErrorDatabase {databaseError :: DatabaseError}
| ChatErrorRemoteCtrl {remoteCtrlError :: RemoteCtrlError}
@@ -1572,7 +1572,7 @@ withAgent :: (AgentClient -> ExceptT AgentErrorType IO a) -> CM a
withAgent action =
asks smpAgent
>>= liftIO . runExceptT . action
>>= liftEither . first (`ChatErrorAgent` Nothing)
>>= liftEither . first (\e -> ChatErrorAgent e (AgentConnId "") Nothing)
withAgent' :: (AgentClient -> IO a) -> CM' a
withAgent' action = asks smpAgent >>= liftIO . action