refactor(loop): disable media cleanup to prevent premature file deletion
This commit is contained in:
parent
56d80373eb
commit
26bee0b791
1 changed files with 13 additions and 11 deletions
|
|
@ -168,18 +168,20 @@ func (al *AgentLoop) Run(ctx context.Context) error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process message and ensure media is released afterward
|
// Process message
|
||||||
func() {
|
func() {
|
||||||
defer func() {
|
// TODO: Re-enable media cleanup after inbound media is properly consumed by the agent.
|
||||||
if al.mediaStore != nil && msg.MediaScope != "" {
|
// Currently disabled because files are deleted before the LLM can access their content.
|
||||||
if releaseErr := al.mediaStore.ReleaseAll(msg.MediaScope); releaseErr != nil {
|
// defer func() {
|
||||||
logger.WarnCF("agent", "Failed to release media", map[string]any{
|
// if al.mediaStore != nil && msg.MediaScope != "" {
|
||||||
"scope": msg.MediaScope,
|
// if releaseErr := al.mediaStore.ReleaseAll(msg.MediaScope); releaseErr != nil {
|
||||||
"error": releaseErr.Error(),
|
// logger.WarnCF("agent", "Failed to release media", map[string]any{
|
||||||
})
|
// "scope": msg.MediaScope,
|
||||||
}
|
// "error": releaseErr.Error(),
|
||||||
}
|
// })
|
||||||
}()
|
// }
|
||||||
|
// }
|
||||||
|
// }()
|
||||||
|
|
||||||
response, err := al.processMessage(ctx, msg)
|
response, err := al.processMessage(ctx, msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue