Skip to content

Conversation

@NiveditJain
Copy link
Member

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 18, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Corrected status handling for multi-output executions: secondary outputs are now immediately marked as executed, ensuring accurate progress display.
    • Improved run monitoring by removing misleading “created” states for additional outputs, reducing confusion in dashboards and logs.
    • Ensures downstream tasks for additional outputs continue to schedule as expected, improving overall flow reliability for multi-output nodes.

Walkthrough

Updated executed_state handling to set status of states created for additional outputs (beyond the first) to EXECUTED at creation time, without altering other fields or background task scheduling. Single-output and zero-output paths remain unchanged apart from this status behavior for subsequent outputs.

Changes

Cohort / File(s) Summary of changes
Executed state handling
state-manager/app/controller/executed_state.py
For multi-output executions, newly created states for outputs[1:] are initialized with status EXECUTED instead of CREATED; other attributes and background task scheduling for next-state creation remain as before.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Controller
  participant StateStore as State Store
  participant Scheduler

  Client->>Controller: executed_state(body with outputs)
  alt No outputs
    Controller->>StateStore: Record executed state
  else One output
    Controller->>StateStore: Create state for first output (EXECUTED)
    Controller->>Scheduler: Schedule next-state task
  else Multiple outputs
    Controller->>StateStore: Create state for first output (EXECUTED)
    Controller->>Scheduler: Schedule next-state task
    loop For each output in outputs[1:]
      Controller->>StateStore: Create state (status=EXECUTED)
      Controller->>Scheduler: Schedule next-state task
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • nk-ag

Poem

A hop and a mark, EXECUTED we say,
For outputs beyond the first hop’s sway.
Tasks in the queue, the carrots align,
States scurry forward, right on time.
Thump-thump—flows advance without delay! 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3ec95ba and 536eeb9.

📒 Files selected for processing (1)
  • state-manager/app/controller/executed_state.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
state-manager/app/controller/executed_state.py (4)
state-manager/app/models/state_status_enum.py (1)
  • StateStatusEnum (4-14)
state-manager/tests/unit/controller/test_executed_state.py (3)
  • test_executed_state_empty_outputs (203-239)
  • test_executed_state_success_multiple_outputs (91-143)
  • test_executed_state_success_single_output (51-87)
state-manager/app/tasks/create_next_state.py (1)
  • create_next_state (16-156)
python-sdk/exospherehost/runtime.py (1)
  • _notify_executed (197-214)
🔇 Additional comments (2)
state-manager/app/controller/executed_state.py (2)

49-49: Marking fan-out states EXECUTED is correct and aligns semantics with create_next_state expectations

Setting status=EXECUTED for additional output states fixes the prior semantic mismatch where we were scheduling create_next_state for states marked CREATED. This makes the downstream flow consistent and less surprising.


42-60: create_next_state accepts EXECUTED clones without issue
The function never gates on the incoming state’s status—it only:

  • reads state.node_name, state.parents, etc.
  • creates downstream states with CREATED
  • finally sets state.status = SUCCESS and saves

Handing off your clones as EXECUTED is safe; no additional status transition is required.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

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

Choose a reason for hiding this comment

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

Summary of Changes

Hello @NiveditJain, 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 a bug where a state, upon execution, was incorrectly assigned a CREATED status instead of an EXECUTED status. The change ensures that the system accurately reflects the true operational status of a state once its execution process is complete.

Highlights

  • State Management Fix: Corrected the status assignment in state-manager/app/controller/executed_state.py from StateStatusEnum.CREATED to StateStatusEnum.EXECUTED when processing an executed state.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@codecov
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

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

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 addresses an issue in the state management logic for nodes that produce multiple outputs. The change correctly sets the status of newly created states for additional outputs to EXECUTED instead of CREATED, which aligns with the intended state machine flow. My review includes a suggestion to enhance the unit tests to cover this specific case and prevent future regressions. For better maintainability, I recommend using more descriptive titles and providing a summary in the pull request body for future changes.

graph_name=state.graph_name,
run_id=state.run_id,
status=StateStatusEnum.CREATED,
status=StateStatusEnum.EXECUTED,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change correctly sets the status to EXECUTED. To prevent future regressions and ensure the correctness of this fix, it's important to add an assertion to the test_executed_state_success_multiple_outputs unit test. The test should verify that the newly created states for multiple outputs are indeed created with the EXECUTED status.

@NiveditJain NiveditJain merged commit 2326ef0 into exospherehost:main Aug 19, 2025
5 checks passed
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.

1 participant