MCPcopy Create free account
hub / github.com/compozy/agh / attachCommandLog

Function attachCommandLog

internal/procutil/detached.go:174–187  ·  view source on GitHub ↗
(err error, logPath string, logOffset int64)

Source from the content-addressed store, hash-verified

172}
173
174func attachCommandLog(err error, logPath string, logOffset int64) error {
175 if err == nil {
176 return nil
177 }
178 text, readErr := readCommandLog(logPath, logOffset)
179 if readErr != nil {
180 return err
181 }
182 text = diagnostics.RedactAndBound(recentCommandError(text), maxDetachedCommandErrorBytes)
183 if text == "" {
184 return err
185 }
186 return fmt.Errorf("%w: stderr=%s", err, text)
187}
188
189func readCommandLog(path string, offset int64) (text string, err error) {
190 file, err := os.Open(path)

Callers 2

waitProcessMethod · 0.85

Calls 3

RedactAndBoundFunction · 0.92
readCommandLogFunction · 0.85
recentCommandErrorFunction · 0.85

Tested by 1