Skip to content

feat: template init bug fixed - #65

Merged
sawradip merged 1 commit into
mainfrom
sawra/templates_fix
Sep 1, 2025
Merged

feat: template init bug fixed#65
sawradip merged 1 commit into
mainfrom
sawra/templates_fix

Conversation

@sawradip

@sawradip sawradip commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added support for a “default” Pythonic type option.
    • Enhanced agent validation to properly handle Pythonic entry points, providing accurate validation results.
  • Refactor

    • Project configuration files generated by the tool no longer include the “framework” field.
  • Style

    • Minor formatting adjustments in configuration handling.
    • Removed explicit return type hints in a template agent; no runtime behavior changes.
    • General code cleanups with no impact on existing functionality.

@coderabbitai

coderabbitai Bot commented Sep 1, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Updates include excluding the framework field from generated project configs, adding PythonicEntryPoint-aware validation logic, inserting a no-op formatting newline in config writing, introducing a DEFAULT enum value for PythonicType, and removing return type annotations from two template methods without changing runtime behavior.

Changes

Cohort / File(s) Summary
Template manager config exclusion
runagent/sdk/template_manager.py
Expanded model_dump exclude set to omit both agent_architecture and framework when creating project config.
Agent validation branch for PythonicEntryPoint
runagent/utils/agent.py
Added import of PythonicEntryPoint and conditional validation: if first entrypoint is PythonicEntryPoint, call validate_pythonic_agent; otherwise return valid result.
Config write formatting
runagent/utils/config.py
Inserted a blank line before json.dump inside the file write context; no logic change.
Enum extension
runagent/utils/enums.py
Added PythonicType.DEFAULT = "default".
Template type annotations removed
templates/default/default/email_agent.py
Removed return type annotations from MockAIAgent.chat_completion_create and MockOpenAIClient.create; parameters and behavior unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant AgentUtils as utils.agent.validate_agent
  participant Schema as PythonicEntryPoint
  participant PyValidator as validate_pythonic_agent

  Caller->>AgentUtils: validate_agent(agent)
  AgentUtils->>AgentUtils: entrypoint = agent.entrypoints[0]
  alt entrypoint is PythonicEntryPoint
    AgentUtils->>PyValidator: validate_pythonic_agent(agent)
    PyValidator-->>AgentUtils: ValidationResult(valid, error_msgs)
    AgentUtils-->>Caller: ValidationResult
  else other entrypoint type
    AgentUtils-->>Caller: ValidationResult(valid=true, error_msgs=[])
  end

  note over AgentUtils: Other logic unchanged
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I tap my paws on fresh new ground,
A default burrow neatly found.
Configs trimmed, the framework gone,
Pythonic paths to hop upon.
Types now lighter, swift we tread—
Validate, create, then forge ahead! 🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Ruff (0.12.2)
runagent/sdk/template_manager.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to parse /pyproject.toml
�[1mCause:�[0m TOML parse error at line 162, column 18
|
162 | target-version = "0.1.20"
| ^^^^^^^^
unknown variant 0.1.20, expected one of py37, py38, py39, py310, py311, py312, py313, py314

runagent/utils/agent.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to parse /pyproject.toml
�[1mCause:�[0m TOML parse error at line 162, column 18
|
162 | target-version = "0.1.20"
| ^^^^^^^^
unknown variant 0.1.20, expected one of py37, py38, py39, py310, py311, py312, py313, py314

runagent/utils/config.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to parse /pyproject.toml
�[1mCause:�[0m TOML parse error at line 162, column 18
|
162 | target-version = "0.1.20"
| ^^^^^^^^
unknown variant 0.1.20, expected one of py37, py38, py39, py310, py311, py312, py313, py314

  • 2 others

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

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 44082bc and b1e39b9.

📒 Files selected for processing (5)
  • runagent/sdk/template_manager.py (1 hunks)
  • runagent/utils/agent.py (2 hunks)
  • runagent/utils/config.py (1 hunks)
  • runagent/utils/enums.py (1 hunks)
  • templates/default/default/email_agent.py (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sawra/templates_fix

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 or @coderabbit 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.

@sawradip sawradip changed the title feat: template init bugged fixed feat: template init bug fixed Sep 1, 2025
@sawradip
sawradip merged commit e2d55f6 into main Sep 1, 2025
1 of 2 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