Added support for all AI agents + docs.#2272
Conversation
WalkthroughRefactors AI coding-agent handling from a CLAUDE-specific selection to an agent-agnostic enabled/disabled flag, introduces AGENTS.md as the primary development guide and adds Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.vortex/installer/src/Prompts/Handlers/AiCodeInstructions.php:
- Around line 46-52: The process() method calls getResponseAsBool() directly
which will throw for legacy string values like "claude" or "none"; before
calling getResponseAsBool() inspect the raw response (e.g. via getResponse() or
the underlying input), coerce legacy string values ("claude","none", etc.) into
the proper boolean value, then call getResponseAsBool(); update process() to use
the coerced value for $v and keep the existing cleanup of $this->tmpDir
.'/AGENTS.md' and '/CLAUDE.md' so non‑interactive installs handle legacy config
strings safely.
| public function process(): void { | ||
| $v = $this->getResponseAsString(); | ||
| $v = $this->getResponseAsBool(); | ||
| $t = $this->tmpDir; | ||
|
|
||
| if ($v !== self::CLAUDE) { | ||
| if (!$v) { | ||
| @unlink($t . '/AGENTS.md'); | ||
| @unlink($t . '/CLAUDE.md'); |
There was a problem hiding this comment.
Handle legacy string values before calling getResponseAsBool().
Line 47 will throw if a user still has legacy env/config values like "claude" or "none" set, which breaks non‑interactive installs. Add a compatibility path to coerce legacy strings to booleans before proceeding.
🩹 Suggested backward‑compatibility fix
- public function process(): void {
- $v = $this->getResponseAsBool();
+ public function process(): void {
+ try {
+ $v = $this->getResponseAsBool();
+ }
+ catch (\RuntimeException $e) {
+ // Backward compatibility for legacy string values (e.g. "claude"/"none").
+ $legacy = $this->getResponseAsString();
+ $v = !in_array(strtolower($legacy), ['none', 'false', '0', 'no'], true);
+ }
$t = $this->tmpDir;
if (!$v) {
`@unlink`($t . '/AGENTS.md');
`@unlink`($t . '/CLAUDE.md');
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| public function process(): void { | |
| $v = $this->getResponseAsString(); | |
| $v = $this->getResponseAsBool(); | |
| $t = $this->tmpDir; | |
| if ($v !== self::CLAUDE) { | |
| if (!$v) { | |
| @unlink($t . '/AGENTS.md'); | |
| @unlink($t . '/CLAUDE.md'); | |
| public function process(): void { | |
| try { | |
| $v = $this->getResponseAsBool(); | |
| } | |
| catch (\RuntimeException $e) { | |
| // Backward compatibility for legacy string values (e.g. "claude"/"none"). | |
| $legacy = $this->getResponseAsString(); | |
| $v = !in_array(strtolower($legacy), ['none', 'false', '0', 'no'], true); | |
| } | |
| $t = $this->tmpDir; | |
| if (!$v) { | |
| `@unlink`($t . '/AGENTS.md'); | |
| `@unlink`($t . '/CLAUDE.md'); |
🤖 Prompt for AI Agents
In @.vortex/installer/src/Prompts/Handlers/AiCodeInstructions.php around lines
46 - 52, The process() method calls getResponseAsBool() directly which will
throw for legacy string values like "claude" or "none"; before calling
getResponseAsBool() inspect the raw response (e.g. via getResponse() or the
underlying input), coerce legacy string values ("claude","none", etc.) into the
proper boolean value, then call getResponseAsBool(); update process() to use the
coerced value for $v and keep the existing cleanup of $this->tmpDir
.'/AGENTS.md' and '/CLAUDE.md' so non‑interactive installs handle legacy config
strings safely.
This comment has been minimized.
This comment has been minimized.
|
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2272 +/- ##
==========================================
- Coverage 77.07% 76.44% -0.63%
==========================================
Files 114 107 -7
Lines 5993 5829 -164
Branches 44 0 -44
==========================================
- Hits 4619 4456 -163
+ Misses 1374 1373 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fe4d4c4 to
a2c76fa
Compare
This comment has been minimized.
This comment has been minimized.
|
|
|
a2c76fa to
5c386fa
Compare
|
|
|
|
Summary by CodeRabbit