Skip to content

Fix REPL single-message hang and cap CI test duration - #1643

Merged
henrypark133 merged 5 commits into
stagingfrom
codex/fix-ci-test-hangs
Mar 25, 2026
Merged

henrypark133 merged 5 commits into
stagingfrom
codex/fix-ci-test-hangs

Conversation

@henrypark133

Copy link
Copy Markdown
Collaborator

Summary

  • fix the REPL single-message regression that kept the channel stream open and could hang the targeted test
  • update the Telegram hot-activation E2E expectation to match the current setup payload shape
  • add job and step timeouts around Rust test workflow jobs so stuck test processes cannot run for GitHub's full default window

Testing

  • cargo test single_message_mode_sends_message_then_quit -- --nocapture
  • cargo test --no-default-features --features libsql single_message_mode_sends_message_then_quit -- --nocapture
  • tests/e2e/.venv/bin/pytest tests/e2e/scenarios/test_telegram_hot_activation.py -v
  • ruby -e 'require "yaml"; YAML.load_file(".github/workflows/test.yml"); puts "workflow ok"'

Notes

  • the REPL test now has per-await timeouts so this regression fails fast if it ever returns
  • the CI workflow now has both job-level timeout-minutes caps and timeout-wrapped cargo test steps as a hard backstop

Copilot AI review requested due to automatic review settings March 25, 2026 16:20
@github-actions github-actions Bot added scope: ci CI/CD workflows size: M 50-199 changed lines risk: medium Business logic, config, or moderate-risk modules labels Mar 25, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses critical stability and reliability concerns across the application and its continuous integration pipeline. It fixes a specific bug in the REPL's single-message handling that could lead to indefinite hangs, ensuring proper resource release. Additionally, it updates an end-to-end test for Telegram hot-activation to reflect current data structures and introduces robust timeout mechanisms in the CI workflow to prevent long-running or stuck tests from blocking the pipeline indefinitely.

Highlights

  • REPL Single-Message Fix: Resolved a regression in the REPL's single-message mode that caused the channel stream to remain open, potentially leading to hangs in tests.
  • Telegram E2E Test Update: Adjusted the expected payload shape in the Telegram hot-activation end-to-end test to align with current setup configurations.
  • CI Test Duration Capping: Implemented job and step timeouts in the Rust test workflow to prevent stuck test processes from consuming excessive GitHub Actions resources.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/test.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refines the ReplChannel's behavior by ensuring that a sender handle is only kept alive for interactive modes, preventing potential resource leaks in single-message scenarios. It also enhances the robustness of the single_message_channel_sends_message_and_quits test by adding timeouts to stream assertions. Additionally, the Telegram hot activation E2E test is updated to standardize the setup payload structure to include an empty fields dictionary. There is no feedback to provide as no review comments were given.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a regression where REPL single-message mode could keep its channel stream open (hanging a targeted test), updates Telegram hot-activation E2E expectations to the current setup payload shape, and adds CI timeouts to prevent stuck Rust test runs from consuming GitHub Actions’ full default runtime.

Changes:

  • Fix REPL single-message mode stream closure behavior and add per-await timeouts to the regression test.
  • Update Telegram hot-activation E2E test to expect fields: {} in setup POST payloads.
  • Add job-level and step-level timeouts to Rust test jobs in the GitHub Actions workflow.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/channels/repl.rs Adjusts sender retention in single-message mode and hardens the regression test with timeouts.
tests/e2e/scenarios/test_telegram_hot_activation.py Updates expected captured setup payloads to include fields.
.github/workflows/test.yml Caps job runtimes and wraps cargo test invocations with timeout to avoid hangs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/channels/repl.rs Outdated
zmanian
zmanian previously approved these changes Mar 25, 2026

@zmanian zmanian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The REPL hang fix is correct -- the extra tx.clone() stored in msg_tx kept the channel open after single-message mode's thread dropped its sender. Gating on self.single_message.is_none() is the right fix since single-message mode never needs the approval injection path.

CI timeout caps are well-layered (job-level + step-level with --signal=INT). Step timeouts correctly nest inside job timeouts with 5-10 min headroom.

One minor note: timeout is a GNU coreutils utility not available on macOS runners. Fine for current ubuntu-only CI, but worth noting if macOS runners are ever added.

Ship it.

Copilot AI review requested due to automatic review settings March 25, 2026 17:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/channels/repl.rs
nickpismenkov
nickpismenkov previously approved these changes Mar 25, 2026
@github-actions github-actions Bot added the scope: agent Agent core (agent loop, router, scheduler) label Mar 25, 2026
@henrypark133
henrypark133 requested a review from Copilot March 25, 2026 18:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/agent/agent_loop.rs
nickpismenkov
nickpismenkov previously approved these changes Mar 25, 2026
@github-actions github-actions Bot added size: L 200-499 changed lines and removed size: M 50-199 changed lines labels Mar 25, 2026
@henrypark133
henrypark133 requested a review from Copilot March 25, 2026 18:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 892 to +898
/// Spawn a fire in a background task.
fn spawn_fire(&self, routine: Routine, trigger_type: &str, trigger_detail: Option<String>) {
fn spawn_fire(
&self,
routine: Routine,
trigger_type: &str,
trigger_detail: Option<String>,
) -> JoinHandle<()> {

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spawn_fire now returns a tokio::task::JoinHandle<()>, which is #[must_use]. There are still call sites in this file that ignore the return value (e.g. in emit_system_event and check_cron_triggers), which will trigger an "unused JoinHandle" warning and fail CI under cargo clippy -D warnings. Please explicitly detach the task (e.g. drop(...) / let _ = ...) or otherwise handle the handle at those call sites.

Copilot uses AI. Check for mistakes.
@henrypark133

Copy link
Copy Markdown
Collaborator Author

Already got approvals were addressing existing bugs from before. filed some issues for the rest + more testing

@henrypark133
henrypark133 merged commit 0341fcc into staging Mar 25, 2026
18 checks passed
@henrypark133
henrypark133 deleted the codex/fix-ci-test-hangs branch March 25, 2026 18:45
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
* Fix REPL single-message hang and cap CI test duration

* Fix Clippy nested-if lint in REPL startup

* Fix single-message approval flow

* Handle empty single-message REPL exits

* Wait for one-shot event routines before exit
drchirag1991 pushed a commit to drchirag1991/ironclaw that referenced this pull request Apr 8, 2026
* Fix REPL single-message hang and cap CI test duration

* Fix Clippy nested-if lint in REPL startup

* Fix single-message approval flow

* Handle empty single-message REPL exits

* Wait for one-shot event routines before exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: medium Business logic, config, or moderate-risk modules scope: agent Agent core (agent loop, router, scheduler) scope: ci CI/CD workflows size: L 200-499 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants