patchRunTrailer returns a short human-readable trailer the agent appends to the tail of a patch run's shell output so the live terminal view has a clear "this is the end" marker regardless of what the underlying package manager printed last. The same text is included in the authoritative fullOutput
(wasStopped bool, stepErr error, dryRun bool)
| 2180 | // fullOutput sent with the terminal stage, so users see the trailer whether |
| 2181 | // they're reading the live WebSocket buffer or the persisted shell_output. |
| 2182 | func patchRunTrailer(wasStopped bool, stepErr error, dryRun bool) string { |
| 2183 | ts := time.Now().UTC().Format(time.RFC3339) |
| 2184 | switch { |
| 2185 | case wasStopped: |
| 2186 | return fmt.Sprintf("\n--- Patch run stopped by user at %s ---\n", ts) |
| 2187 | case stepErr != nil: |
| 2188 | return fmt.Sprintf("\n--- Patch run failed at %s ---\n", ts) |
| 2189 | case dryRun: |
| 2190 | return fmt.Sprintf("\n--- Dry run completed at %s ---\n", ts) |
| 2191 | default: |
| 2192 | return fmt.Sprintf("\n--- Patch run completed at %s ---\n", ts) |
| 2193 | } |
| 2194 | } |
| 2195 | |
| 2196 | // When dryRun is true, simulates and sends dry_run_completed instead of completed. |
| 2197 | func runPatch(patchRunID, patchType string, packageNames []string, dryRun bool) error { |
no outgoing calls
no test coverage detected