claudetool: add some cleanup TODOs to bash background execution
diff --git a/claudetool/bash.go b/claudetool/bash.go
index 233b0b7..2edd230 100644
--- a/claudetool/bash.go
+++ b/claudetool/bash.go
@@ -114,6 +114,7 @@
return "", err
}
// Marshal the result to JSON
+ // TODO: emit XML(-ish) instead?
output, err := json.Marshal(result)
if err != nil {
return "", fmt.Errorf("failed to marshal background result: %w", err)
@@ -254,6 +255,8 @@
if timeout > 0 {
// Launch a goroutine that will kill the process after the timeout
go func() {
+ // TODO(josh): this should use a context instead of a sleep, like executeBash above,
+ // to avoid goroutine leaks. Possibly should be partially unified with executeBash.
// Sleep for the timeout duration
time.Sleep(timeout)