feat(#276): collect OpenShell logs before sandbox deletion - #555
Merged
Conversation
Add log collection step to the sandbox cleanup flow so that OpenShell gateway and sandbox logs are preserved in the run output directory for post-mortem debugging and CI artifact collection. Changes: - sandbox.CollectLogs(): new function that runs `openshell logs <name> --source <source> -n 0` with a 30s timeout to retrieve all available log lines - collectOpenshellLogs(): orchestrator that collects both sandbox and gateway log sources, writing them to <run-dir>/logs/openshell-sandbox.log and <run-dir>/logs/openshell-gateway.log - Log collection runs in the cleanup defer before sandbox.Delete(), ensuring logs are captured on both success and failure paths - Failures are warned but never block the run (best-effort) Note: pre-commit could not run due to network restrictions in the sandbox environment (exit code 3, 403 Forbidden on hook installation). The post-script runs an authoritative pre-commit check on the runner. Closes #276
Site previewPreview: https://79d56dfd-site.fullsend-ai.workers.dev Commit: |
Review: #555Head SHA: e46cdea SummaryClean, well-scoped change that adds best-effort OpenShell log collection to the sandbox cleanup flow, matching the intent and scope of issue #276. The implementation follows existing patterns in the codebase (exec.CommandContext with separate args, timeout handling, warn-but-don't-block error handling). No security, correctness, or injection concerns found. FindingsCriticalNone. HighNone. MediumNone. Low
Info
FooterOutcome: approve |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add log collection step to the sandbox cleanup flow so that OpenShell gateway and sandbox logs are preserved in the run output directory for post-mortem debugging and CI artifact collection.
Changes:
openshell logs <name> --source <source> -n 0with a 30stimeout to retrieve all available log lines
sandbox and gateway log sources, writing them to
/logs/openshell-sandbox.log and
/logs/openshell-gateway.log
sandbox.Delete(), ensuring logs are captured on both
success and failure paths
Note: pre-commit could not run due to network restrictions in the sandbox environment (exit code 3, 403 Forbidden on hook installation). The post-script runs an authoritative pre-commit check on the runner.
Closes #276
Post-script verification
agent/276-collect-openshell-logs)94f67c43a41ec9974542ec6d6db660282c50120c..HEAD)