Skip to content

Fixed the bug that crashes the program if no policy file was attached. - #37

Open
Saaketh0 wants to merge 1 commit into
mainfrom
bug/policy-crashes
Open

Fixed the bug that crashes the program if no policy file was attached.#37
Saaketh0 wants to merge 1 commit into
mainfrom
bug/policy-crashes

Conversation

@Saaketh0

@Saaketh0 Saaketh0 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

A one line fix for #14 . Instead of crashing the program, this fix would just return an empty list of policies, having the same effect as no policy.

In addition, fixed one of the example files to reflect the removal of the "Stub" suffix.

Summary by CodeRabbit

  • Bug Fixes

    • Policy publication now proceeds correctly when no policy file is present.
    • Policy rule counts remain available even when no rules have been configured.
  • Improvements

    • The example workflow now uses the standard example agent, while deployment and greeting behavior remain unchanged.

@Saaketh0
Saaketh0 requested a review from iidsample August 6, 2026 18:05
@Saaketh0 Saaketh0 self-assigned this Aug 6, 2026
@Saaketh0 Saaketh0 added the bug Something isn't working label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Hello World workflow now uses ExampleAgent. Global policy loading now returns an empty rule list when policy.yaml is absent.

Changes

Workflow agent update

Layer / File(s) Summary
Use ExampleAgent
examples/helloworld/workflow/example_workflow.py
The workflow imports and instantiates ExampleAgent instead of ExampleAgentStub.

Policy loading update

Layer / File(s) Summary
Handle missing policy files
ventis/controller/global_controller.py
The missing-policy-file branch returns an empty rule list instead of None.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: iidsample

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: fixing the crash that occurs when no policy file is attached.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug/policy-crashes

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/helloworld/workflow/example_workflow.py`:
- Around line 18-22: Update main after calling ExampleAgent.hello() to treat its
result as a string and return or print greeting directly, removing the
greeting.value() call while preserving the existing workflow behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 89fb6c6f-80d3-4cb0-9317-59b03823acf3

📥 Commits

Reviewing files that changed from the base of the PR and between 48f7ee7 and e39b1ef.

📒 Files selected for processing (2)
  • examples/helloworld/workflow/example_workflow.py
  • ventis/controller/global_controller.py

Comment on lines +18 to +22
from example_agent import ExampleAgent


def main(name: str = "World"):
agent = ExampleAgentStub()
agent = ExampleAgent()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Update the greeting extraction for ExampleAgent.

ExampleAgent.hello() returns a str, but main still calls greeting.value() at Line 24. This causes an AttributeError for every invocation. Return greeting directly or adapt the workflow to the new return type.

Proposed fix
-    return {"greeting": greeting.value()}
+    return {"greeting": greeting}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/helloworld/workflow/example_workflow.py` around lines 18 - 22,
Update main after calling ExampleAgent.hello() to treat its result as a string
and return or print greeting directly, removing the greeting.value() call while
preserving the existing workflow behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant