mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[GH-ISSUE #145] [Bug] Silent error handling in GetTool causes cryptic failures when primary container is missing #61
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zesty-clawd on GitHub (Feb 24, 2026).
Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/145
Bug Description
In
backend/cmd/ftester/worker/executor.go, theGetToolmethod silently ignores errors fromGetFlowPrimaryContainer, which leads to confusing downstream failures when terminal or file operations are attempted.Affected Code
File:
backend/cmd/ftester/worker/executor.go(lines 99-102)Problem
When
GetFlowPrimaryContainerfails:containerIDremains0andcontainerLIDremains""NewTerminalToolorNewFileToolis created with invalid container identifiersExecCommandis called (interminal.go:144), it callst.dockerClient.IsContainerRunning(ctx, t.containerLID)with an empty stringImpact
Expected Behavior
GetToolshould:GetFlowPrimaryContainerSuggested Fix
Related Code Paths
executor.go:106-114executor.go:116-124(also uses same container identifiers)pkg/tools/terminal.go:144-149Environment
Lesson for Code Quality
This bug demonstrates the danger of optimistic error handling patterns (
if err == nil { ... }without else-handling) when the error condition is critical to downstream logic. When resource retrieval fails, systems should fail fast with clear context rather than silently propagating invalid state.@asdek commented on GitHub (Mar 2, 2026):
thank you for the Issue, it was changed by #152