Skip to content

Fix incomplete model discovery in GuidelineAssist class#749

Closed
iz-ahmad wants to merge 3 commits intolaravel:mainfrom
iz-ahmad:fix/incomplete-model-discovery-GuidelineAssist
Closed

Fix incomplete model discovery in GuidelineAssist class#749
iz-ahmad wants to merge 3 commits intolaravel:mainfrom
iz-ahmad:fix/incomplete-model-discovery-GuidelineAssist

Conversation

@iz-ahmad
Copy link
Copy Markdown
Contributor

@iz-ahmad iz-ahmad commented Apr 6, 2026

fixes issue #716

laravel-boost-application-info was returning an incomplete model list (e.g., only User) when asked any AI agent to list the models.

Likely root cause was: discover() in GuidelineAssist.php used:

class_exists($className, false)

here, passing false disables autoloading, so any model classes that weren't already loaded in memory - would be silently skipped.

Changes made

  • src/Install/GuidelineAssist.php — Replaced class_exists($className, false) with class_exists($className) to allow Composer autoloading, ensuring all autoloadable models are discovered.
  • tests/Unit/Install/GuidelineAssistTest.php — Added a test verifying that discover() detects models that were not previously loaded.
  • tests/Fixtures/app/Models/ExtraModel.php — Added a simple Eloquent model fixture to validate if the fix is working.

Thanks.

@pushpak1300
Copy link
Copy Markdown
Member

This isn’t a reliable way because if there’s an incorrect class throwing warnings and fatal errors the boost won’t start.

@pushpak1300 pushpak1300 marked this pull request as draft April 6, 2026 11:33
@pushpak1300
Copy link
Copy Markdown
Member

I’m considering removing this functionality as it adds unnecessary bloat to the context and isn’t helpful. Furthermore, there are so many edge cases to get it right. Today’s model can intelligently determine which model exists and which doesn’t by searching the codebase.

@pushpak1300 pushpak1300 closed this Apr 6, 2026
@iz-ahmad
Copy link
Copy Markdown
Contributor Author

iz-ahmad commented Apr 6, 2026

Furthermore, there are so many edge cases to get it right. Today’s model can intelligently determine which model exists and which doesn’t by searching the codebase.

Yeah, just saw your PR #754.. I understand, thanks.

@iz-ahmad iz-ahmad deleted the fix/incomplete-model-discovery-GuidelineAssist branch April 24, 2026 21:57
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.

2 participants