Repository navigation
fix(sessions): keep the step's outputs when a session log is over 1 GB - #855
Merged
Merged
Conversation
A log the container uploaded but storage refused (over SessionLogUploader's 1 GB limit) raised out of LogCollector and aborted before_cleanup at its first line, so the step failed and its outputs, rotated credentials and usage were never collected. Each log now succeeds or fails on its own: one over the limit keeps a bounded tail, a refused upload falls back to the bounded read, and either lands in the collection report. Kiro tracked all of amazonaws.com, so the agent's own AWS traffic (aws CLI answers, image layers from S3) went into http.log with bodies. Its usage is read from kiro.dev hosts only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
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.
Problem
A Kiro workflow step failed with
Output collection failed: Validation failed: File is too large (max is 1 GB), and the outputs it had written were lost./var/log/mitm/http.logstraight to cache storage.LogCollector#persistthen attaches it, andSessionLogUploaderrefuses anything over 1 GB.LogCollector#calland stoppedAgentSessionStrategy#before_cleanupat its first line,collect_logs. Everything after it was skipped: outputs, refreshed credentials, credential metadata and usage. The activity then marked the session, and the step, failed.amazonaws.com. Everything the agent does against AWS (awsCLI answers, image layers pulled from S3) was written with full bodies. Kiro's own traffic, and everything#collect_usagereads, is on*.kiro.dev.Change
Sessions::LogCollector: each log succeeds or fails on its own.SessionLogUploader::MAX_SIZEskips the upload and keeps a bounded tail.log-collection-report.txt.AgentSessionStrategy#collect_logsrescues likecollect_terminal_outputalready does. A log can no longer take outputs, credentials or usage down with it.Agents::KiroCliAdapter#mitm_tracked_domains:kiro.devonly.SessionLogUploader::MAX_SIZEnames the limit the validator and the collector share.Tests
log_collector_test: a log over the limit is kept as a tail, the rest are still collected, and the report says why. An upload storage refuses falls back to the bounded read.workflow_step_strategy_test: outputs are collected when log collection raises.kiro_cli_adapter_test: the proxy trackskiro.devonly.The three new collector and strategy tests fail on
developwith the original exception and pass here. I ran the touched test files, the full rubocop and brakeman locally.🤖 Generated with Claude Code