Skip to content

fix: handle nested SequenceMsg in event loop and use sync.WaitGroup f…#1463

Merged
aymanbagabas merged 2 commits intomainfrom
nested-seqmsg
Aug 8, 2025
Merged

fix: handle nested SequenceMsg in event loop and use sync.WaitGroup f…#1463
aymanbagabas merged 2 commits intomainfrom
nested-seqmsg

Conversation

@aymanbagabas
Copy link
Copy Markdown
Member

…or BatchMsg

This simplifies the handling of nested BatchMsg within sequenceMsg and ensures that all commands in a BatchMsg are executed before proceeding. It also replaces errgroup with sync.WaitGroup for better clarity and performance when waiting for multiple goroutines to finish.

Fixes: #680
Supersedes: #843

…or BatchMsg

This simplifies the handling of nested BatchMsg within sequenceMsg and ensures
that all commands in a BatchMsg are executed before proceeding.
It also replaces errgroup with sync.WaitGroup for better clarity and performance
when waiting for multiple goroutines to finish.

Fixes: #680
Supersedes: #843
@aymanbagabas aymanbagabas requested review from a team, andreynering and caarlos0 August 7, 2025 15:30
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.04%. Comparing base (c76509a) to head (c315a14).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tea.go 71.42% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1463      +/-   ##
==========================================
- Coverage   70.22%   69.04%   -1.19%     
==========================================
  Files          17       17              
  Lines        1733     1741       +8     
==========================================
- Hits         1217     1202      -15     
- Misses        468      485      +17     
- Partials       48       54       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aymanbagabas aymanbagabas merged commit f5da8d0 into main Aug 8, 2025
37 of 40 checks passed
@aymanbagabas aymanbagabas deleted the nested-seqmsg branch August 8, 2025 19:04
meowgorithm added a commit to charmbracelet/crush that referenced this pull request Aug 8, 2025
meowgorithm added a commit to charmbracelet/crush that referenced this pull request Aug 8, 2025
aymanbagabas added a commit that referenced this pull request Aug 13, 2025
Otherwise, it blocks on cmd()

Fixes: f5da8d0 (fix: handle nested SequenceMsg in event loop and use sync.WaitGroup f… (#1463))
aymanbagabas added a commit that referenced this pull request Aug 15, 2025
The commands channel handler handles commands and their execution. We
should not execute them ourself in the event loop and instead send them
to the commands channel where the handles will take care of executing
them.

Fixes: f5da8d0 (fix: handle nested SequenceMsg in event loop and use sync.WaitGroup f… (#1463))
aymanbagabas added a commit that referenced this pull request Aug 15, 2025
The commands channel handler handles commands and their execution. We
should not execute them ourself in the event loop and instead send them
to the commands channel where the handles will take care of executing
them.

Fixes: f5da8d0 (fix: handle nested SequenceMsg in event loop and use sync.WaitGroup f… (#1463))
scalabl3 pushed a commit to metaphori-ai/crush that referenced this pull request Aug 19, 2025
aymanbagabas added a commit that referenced this pull request Sep 8, 2025
… event loop

We shouldn't execute commands in the event loop ourselves. Instead, we
should send them to the commands channel where the command handlers will
take care of executing them.

Fixes: f5da8d0 (fix: handle nested SequenceMsg in event loop and use sync.WaitGroup f… (#1463))
Supersedes: #1485
aymanbagabas added a commit that referenced this pull request Sep 8, 2025
… event loop

We shouldn't execute commands in the event loop ourselves. Instead, we
should send them to the commands channel where the command handlers will
take care of executing them.

Fixes: f5da8d0 (fix: handle nested SequenceMsg in event loop and use sync.WaitGroup f… (#1463))
Supersedes: #1485
aymanbagabas added a commit that referenced this pull request Sep 8, 2025
… event loop (#1473)

We shouldn't execute commands in the event loop ourselves. Instead, we
should send them to the commands channel where the command handlers will
take care of executing them.

Fixes: f5da8d0 (fix: handle nested SequenceMsg in event loop and use sync.WaitGroup f… (#1463))
Supersedes: #1485
OHANA-WEB added a commit to OHANA-WEB/crush that referenced this pull request Jan 21, 2026
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.

Incorrect order when nesting Sequence commands

2 participants