Skip to content

Conversation

@NiveditJain
Copy link
Member

No description provided.

- Introduced a new node, DownloadS3FileNode, for downloading files from S3.
- Updated main.py to include the new node in the runtime configuration.
- Removed unused 'store' field from NodeTemplate model in state-manager.

This enhances the cloud storage functionality by allowing file downloads directly from S3.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 9, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added support for downloading files from S3 in the cloud storage runtime.
  • Bug Fixes

    • Improved validation to ensure all node input and output fields are strings.
  • Documentation

    • Updated SDK documentation to clarify that all node inputs, outputs, and secrets must be strings, with updated examples.
  • Chores

    • Removed deprecated sample and status code.
    • Updated SDK version to 0.0.7b5.
    • Removed an unused field from node template models.

Walkthrough

A new DownloadS3FileNode was added to the cloud storage runtime and registered in the runtime's node list. The Python SDK documentation and example code were updated to enforce string-only fields for node models. Additional validation was added to ensure node model fields are strings. Unused code, including a sample node and the Status enum, was removed.

Changes

Cohort / File(s) Change Summary
Cloud Storage Runtime Node Addition
exosphere-runtimes/cloud-storage-runtime/nodes/download_s3_file.py, exosphere-runtimes/cloud-storage-runtime/main.py
Added DownloadS3FileNode for downloading S3 objects, including input/output/secret models and execution logic. Registered the node in the runtime initialization.
Python SDK String-only Enforcement
python-sdk/README.md, python-sdk/exospherehost/runtime.py
Updated documentation and example code to require all Inputs, Outputs, and Secrets fields to be strings. Added runtime validation to enforce this constraint in node models.
SDK Version Update
python-sdk/exospherehost/_version.py
Bumped SDK version from 0.0.7b4 to 0.0.7b5.
Node Status Cleanup
python-sdk/exospherehost/node/__init__.py, python-sdk/exospherehost/node/status.py
Removed the Status enum from exports and deleted its definition.
Sample Node Removal
python-sdk/sample.py
Deleted the sample node and its runtime registration.
NodeTemplate Model Pruning
state-manager/app/models/node_template_model.py
Removed the store field from the NodeTemplate class.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DownloadS3FileNode
    participant AWS_S3

    User->>DownloadS3FileNode: Provide bucket_name, key, AWS credentials
    DownloadS3FileNode->>AWS_S3: Initiate S3 client with credentials
    DownloadS3FileNode->>AWS_S3: Download object (bucket_name, key)
    AWS_S3-->>DownloadS3FileNode: Return file data
    DownloadS3FileNode-->>User: Return Outputs(file_path)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

Poem

A rabbit hops through cloud and code,
Downloading files from S3’s abode.
Strings are now the only way,
For inputs, outputs, secrets—yay!
Old nodes pruned, new ones bloom,
Version bumps and docs resume.
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

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

🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
  • 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 src/utils.ts and explain its main purpose.
    • @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 comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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 primarily focuses on enhancing the cloud-storage-runtime by adding a new capability to download files from S3. Concurrently, I've made significant updates to the exospherehost SDK to standardize data handling within nodes, ensuring that all inputs, outputs, and secrets are strictly string-based. This change is accompanied by relevant documentation updates and new validation rules. Additionally, I've performed some general cleanup by removing unused components and simplifying a core data model in the state manager.

Highlights

  • New S3 Download Node: I've introduced a new DownloadS3FileNode within the cloud-storage-runtime. This node provides functionality to download specific files from an S3 bucket, requiring the bucket name, file key, and AWS credentials.
  • Enforced String-Only Data Model for Nodes: I've updated the exospherehost SDK to enforce a strict string-only data model for Inputs, Outputs, and Secrets fields in nodes. This change is reflected in the README.md with updated examples and new validation logic in the runtime.
  • Codebase Cleanup and Refactoring: I've removed the Status enum and the sample.py file from the python-sdk to streamline the codebase.
  • NodeTemplate Model Simplification: I've removed the store field from the NodeTemplate model in the state-manager to simplify the data structure.
  • Version Update: I've bumped the exospherehost SDK version to 0.0.7b5.
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 or fill out our survey to provide feedback.

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.

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 introduces version 0.0.7b5, which includes a new DownloadS3FileNode for the cloud storage runtime and enforces a string-only data model for node Inputs, Outputs, and Secrets in the Python SDK. The SDK's README.md has been updated to reflect this significant change. My review focuses on a critical bug in the new S3 download node, a potential issue in a code example in the README, and opportunities for code simplification and robustness. Overall, the changes are a good step towards simplifying the data model, but a few areas need attention to ensure correctness and maintainability.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 10

🔭 Outside diff range comments (1)
python-sdk/exospherehost/node/__init__.py (1)

1-11: Docstring still references removed Status.

Lines 8-11 mention “Status constants” but the enum and its re-export were deleted. Remove or update this section to avoid confusing SDK users.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ba5a56 and 4cd22ea.

📒 Files selected for processing (9)
  • exosphere-runtimes/cloud-storage-runtime/main.py (2 hunks)
  • exosphere-runtimes/cloud-storage-runtime/nodes/download_s3_file.py (1 hunks)
  • python-sdk/README.md (8 hunks)
  • python-sdk/exospherehost/_version.py (1 hunks)
  • python-sdk/exospherehost/node/__init__.py (1 hunks)
  • python-sdk/exospherehost/node/status.py (0 hunks)
  • python-sdk/exospherehost/runtime.py (1 hunks)
  • python-sdk/sample.py (0 hunks)
  • state-manager/app/models/node_template_model.py (0 hunks)
💤 Files with no reviewable changes (3)
  • state-manager/app/models/node_template_model.py
  • python-sdk/exospherehost/node/status.py
  • python-sdk/sample.py
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-03T04:26:00.148Z
Learnt from: NiveditJain
PR: exospherehost/exospherehost#131
File: state-manager/app/models/executed_models.py:0-0
Timestamp: 2025-08-03T04:26:00.148Z
Learning: The exospherehost project is currently in beta phase, so breaking changes in APIs are acceptable and don't require versioning or migration strategies.

Applied to files:

  • python-sdk/exospherehost/_version.py
📚 Learning: 2025-08-02T12:43:35.075Z
Learnt from: NiveditJain
PR: exospherehost/exospherehost#130
File: .github/workflows/ci.yml:22-22
Timestamp: 2025-08-02T12:43:35.075Z
Learning: The exospherehost project requires Python versions > 3.12 for the CI workflow, meaning Python 3.13 or higher should be used despite potential stability concerns with pre-release versions.

Applied to files:

  • python-sdk/exospherehost/_version.py
🧬 Code Graph Analysis (2)
python-sdk/exospherehost/node/__init__.py (2)
python-sdk/exospherehost/node/status.py (1)
  • Status (11-44)
python-sdk/exospherehost/node/BaseNode.py (1)
  • BaseNode (6-73)
python-sdk/exospherehost/runtime.py (2)
exosphere-runtimes/cloud-storage-runtime/nodes/list_s3_files.py (2)
  • Inputs (9-13)
  • Outputs (15-16)
python-sdk/exospherehost/node/BaseNode.py (3)
  • Inputs (29-35)
  • Outputs (37-43)
  • _execute (45-56)
🪛 LanguageTool
python-sdk/README.md

[grammar] ~26-~26: Use the right pronoun
Context: ...Serialize complex data (e.g., JSON) and parse inside your node. ### Basic Node Creat...

(QB_NEW_EN_OTHER_ERROR_IDS_9)


[grammar] ~26-~26: Use correct spacing
Context: ...data (e.g., JSON) and parse inside your node. ### Basic Node Creation Create a simple nod...

(QB_NEW_EN_OTHER_ERROR_IDS_5)

🔇 Additional comments (10)
python-sdk/exospherehost/_version.py (1)

1-1: Version bump looks fine.

No functional impact beyond metadata.

exosphere-runtimes/cloud-storage-runtime/main.py (1)

4-4: Missing DownloadS3FileNode import path check.

If download_s3_file.py sits under nodes/, the relative import is correct. Otherwise the runtime will fail on start-up. Double-check that the file really is exosphere-runtimes/cloud-storage-runtime/nodes/download_s3_file.py.

python-sdk/exospherehost/node/__init__.py (1)

15-15: Export set updated—OK.

__all__ now only exposes BaseNode, matching the actual public surface.

python-sdk/README.md (7)

39-44: Examples correctly reflect v1 string-only model

Inputs/Outputs switched to str look consistent with the stated constraint.


47-52: Example execution snippet aligns with string-only constraint

The processing and return shape are clear and correct for v1.


56-59: Runtime init example looks good

Names are strings and node registration is clear.


129-134: Error-handling example stays consistent with string-only outputs

The example conveys failure propagation clearly.


145-145: Import for JSON serialization is appropriate

Matches the example usage below.


152-154: Outputs reflect v1 string-only model

Looks consistent and clear.


186-186: Secrets section clearly states string-only constraint

Consistent with the rest of the README.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (7)
exosphere-runtimes/cloud-storage-runtime/main.py (1)

11-14: Good clarification on node ordering—resolves the earlier nit.

Explicitly noting that execution is orchestrated by the state manager addresses the prior comment about implicit ordering.

python-sdk/README.md (6)

26-27: Tighten phrasing in the Important note

Consider changing “parse that string within your node” to “parse it within your node” for concision. Spacing looks good now with the added blank line.

-> Important: In v1, all fields in `Inputs`, `Outputs`, and `Secrets` must be strings. If you need to pass complex data (e.g., JSON), serialize the data to a string first, then parse that string within your node.
+> Important: In v1, all fields in `Inputs`, `Outputs`, and `Secrets` must be strings. If you need to pass complex data (e.g., JSON), serialize the data to a string first, then parse it within your node.

76-76: Link to enforcement details or add a short migration note

Add a pointer to where this is enforced (runtime validation) or a brief migration workflow from non-string models to v1 to reduce confusion.

Would you like me to draft a short “Migration to v1 (string-only models)” subsection and reference the runtime validation check?


109-114: Call out numeric-string expectation for max_length

Since Inputs are strings, users might pass non-numeric max_length. Add a brief guard/remark to set expectations before converting to int.

Example:

  • “max_length must be a numeric string (e.g., '100').”

116-119: Safely parse max_length with a clear error

Avoid confusing runtime errors if max_length is non-numeric.

-        max_length = int(self.inputs.max_length)
-        result = self.inputs.text[:max_length]
-        return self.Outputs(result=result, length=str(len(result)))
+        try:
+            max_length = int(self.inputs.max_length)
+        except ValueError as e:
+            raise ValueError("Inputs.max_length must be a numeric string") from e
+        result = self.inputs.text[:max_length]
+        return self.Outputs(result=result, length=str(len(result)))

167-171: Raise for HTTP errors to avoid serializing error payloads

Call raise_for_status() so non-2xx responses don’t flow through as “success”.

         async with httpx.AsyncClient() as client:
             http_response = await client.post(
                 f"{self.secrets.api_endpoint}/process",
                 headers=headers,
                 json={"user_id": self.inputs.user_id, "query": self.inputs.query}
             )
+            http_response.raise_for_status()

173-182: Prefer text, then safely fall back to JSON if empty

Current logic prioritizes JSON even when text is available and catches broad exceptions. Prefer text first; if empty, try JSON; catch ValueError only.

-        # Serialize body: prefer JSON if valid; fallback to text or empty string
-        response_text = http_response.text or ""
-        if response_text:
-            try:
-                response_str = json.dumps(http_response.json())
-            except Exception:
-                response_str = response_text
-        else:
-            response_str = ""
+        # Serialize non-string data to string (prefer text; fall back to JSON if empty and valid)
+        response_str = http_response.text
+        if not response_str:
+            try:
+                response_str = json.dumps(http_response.json())
+            except ValueError:
+                response_str = ""
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4cd22ea and f6f137a.

📒 Files selected for processing (2)
  • exosphere-runtimes/cloud-storage-runtime/main.py (1 hunks)
  • python-sdk/README.md (8 hunks)
🧰 Additional context used
🪛 LanguageTool
python-sdk/README.md

[grammar] ~26-~26: Use correct spacing
Context: ...rst, then parse that string within your node. ### Basic Node Creation Create a simple nod...

(QB_NEW_EN_OTHER_ERROR_IDS_5)

🔇 Additional comments (10)
exosphere-runtimes/cloud-storage-runtime/main.py (1)

4-4: Import looks correct and consistent.

Importing DownloadS3FileNode mirrors the existing pattern and is aligned with the node registration approach.

python-sdk/README.md (9)

39-39: LGTM: Explicit v1 string-only comment

Clear and consistent with v1 constraints.


43-43: LGTM: Explicit v1 string-only comment

Clear and consistent with v1 constraints.


47-52: Example reads well and aligns with v1

Good call-out to serialize complex data and return strings.


56-56: LGTM: Namespace shown as a string

Matches the v1 string-only messaging.


129-129: LGTM: Outputs typed as strings

Consistent with v1; example intentionally throws to demonstrate error handling elsewhere.


144-144: LGTM: Import json where used

Keeps the example self-contained.


152-154: LGTM: Output fields as strings

Matches the string-only guidance for v1.


184-186: LGTM: Return stringified payload and status

Consistent with v1 outputs and earlier guidance.


193-193: LGTM: Secrets called out as strings

Clear reinforcement of the v1 constraint.

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