Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

Compaction was running synchronously in the REPL main thread, blocking user input for 1-5 seconds. Per ADR-009, this should match Python ADK's async behavior.

Changes

  • Wrapped compaction logic in go func() { ... }() to run asynchronously
  • Removed spinner UI (unsafe across goroutines)
  • Replaced fmt.Printf with log.Printf for background logging

Before/After

Before:

// Blocks REPL for 1-5 seconds
if !hasError && r.config.SessionManager != nil {
    compactionSpinner := display.NewSpinner(...)
    compactionSpinner.Start()
    coordinator.RunCompaction(ctx, sess)
    compactionSpinner.Stop()
}

After:

// Non-blocking async execution
if !hasError && r.config.SessionManager != nil {
    go func() {
        coordinator.RunCompaction(ctx, sess)
        log.Printf("Compaction complete")
    }()
}

Follows ADR-009 reference implementation pattern (lines 847-870).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: raphaelmansuy <1003084+raphaelmansuy@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on Feat/compaction PR Make session history compaction asynchronous Nov 16, 2025
Copilot AI requested a review from raphaelmansuy November 16, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants