fix: pattern match new prints correctly (#2213)

Co-authored-by: Caren Thomas <caren@caren-mac.local>
This commit is contained in:
cthomas 2024-12-10 10:38:17 -08:00 committed by GitHub
parent 666e4259cf
commit 975aca155f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -43,7 +43,7 @@ jobs:
NEW_PRINTS=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} "$file" | \
grep "^+" | \
grep -v "^+++" | \
grep "print(" || true)
grep -E "(^|\s)print\(" || true)
if [ ! -z "$NEW_PRINTS" ]; then
echo "❌ Found new print statements in $file:"

View File

@ -201,7 +201,10 @@ class ToolExecutionSandbox:
func_result, stdout = self.parse_out_function_results_markers(result.stdout)
func_return, agent_state = self.parse_best_effort(func_result)
return SandboxRunResult(
func_return=func_return, agent_state=agent_state, stdout=[stdout], sandbox_config_fingerprint=sbx_config.fingerprint()
func_return=func_return,
agent_state=agent_state,
stdout=[stdout],
sandbox_config_fingerprint=sbx_config.fingerprint(),
)
except subprocess.TimeoutExpired:
raise TimeoutError(f"Executing tool {self.tool_name} has timed out.")