Skip to content

feat(ai): add make:agent artisan command#1432

Merged
hwbrzzl merged 2 commits into
masterfrom
bowen/#916-1
Mar 30, 2026
Merged

feat(ai): add make:agent artisan command#1432
hwbrzzl merged 2 commits into
masterfrom
bowen/#916-1

Conversation

@hwbrzzl

@hwbrzzl hwbrzzl commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add make:agent artisan command to scaffold new AI agent files
  • Register the command in the AI service provider's Boot method
  • Enable the AI binding dependency on Config in the binding registry

Closes goravel/goravel#916

Why

The AI module lacked a scaffolding command, requiring developers to manually create agent files. The new make:agent command generates a boilerplate agent struct in app/agents/ with the correct interface methods, consistent with other make:* commands in the framework.

// Generate a new agent at app/agents/my_agent.go
php artisan make:agent MyAgent
// or with go
go run artisan make:agent MyAgent

The AI binding entry in the registry was commented out and its Dependencies field was missing, which prevented proper dependency ordering during boot. These are now activated so the AI service provider correctly declares its dependency on the Config binding.

image

@hwbrzzl
hwbrzzl requested a review from a team as a code owner March 30, 2026 09:02
@codecov

codecov Bot commented Mar 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.18182% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.76%. Comparing base (79b727e) to head (e02639a).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
ai/console/agent_make_command.go 90.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1432      +/-   ##
==========================================
+ Coverage   68.71%   68.76%   +0.04%     
==========================================
  Files         359      361       +2     
  Lines       27733    27776      +43     
==========================================
+ Hits        19058    19099      +41     
- Misses       7830     7831       +1     
- Partials      845      846       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hwbrzzl

hwbrzzl commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

1 similar comment
@hwbrzzl

hwbrzzl commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The head commit changed during the review from f31cb83 to e02639a.

✨ 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 bowen/#916-1

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 and usage tips.

@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Adds scaffolding support for the AI module by introducing a make:agent artisan command, wiring it into the AI service provider, and activating the AI binding entry (with Config dependency) in the binding registry so dependency ordering works correctly.

Changes:

  • Enable binding.AI in the binding registry and declare its dependency on binding.Config.
  • Add ai/console/AgentMakeCommand + stub template to generate agent boilerplate under app/agents/.
  • Register the new command in ai.ServiceProvider.Boot() and add tests for both the command and provider boot.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
contracts/binding/binding.go Activates the AI binding entry and sets Config as a dependency for ordering.
ai/service_provider.go Uses binding-declared dependencies and registers make:agent during boot.
ai/service_provider_test.go Adds a boot test asserting commands registration is invoked.
ai/console/stubs.go Introduces the agent scaffold stub template.
ai/console/agent_make_command.go Implements the make:agent generator command.
ai/console/agent_make_command_test.go Adds filesystem-based tests covering command behavior and generated content.

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

Comment thread ai/console/agent_make_command.go
Comment thread ai/service_provider_test.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@hwbrzzl
hwbrzzl merged commit 4b3811a into master Mar 30, 2026
18 checks passed
@hwbrzzl
hwbrzzl deleted the bowen/#916-1 branch March 30, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] AI SDK Phase 2: Manager, OpenAI Driver, and CLI

2 participants