Skip to content

feat(#741): Delete AgentType class (Phases 4-5)#750

Merged
chubes4 merged 1 commit intomainfrom
feature/741-delete-agent-type
Mar 9, 2026
Merged

feat(#741): Delete AgentType class (Phases 4-5)#750
chubes4 merged 1 commit intomainfrom
feature/741-delete-agent-type

Conversation

@chubes4
Copy link
Member

@chubes4 chubes4 commented Mar 9, 2026

Summary

Final phases of #741 — delete the AgentType class entirely. Contexts replace it.

What changed

  • Deleted inc/Engine/AI/AgentType.php — the class had 3 string constants (PIPELINE, CHAT, SYSTEM), a getAll() registry, isValid() validator, and a dead getLogFilename() method (logging moved to DB in feat(#746): Modernize DM Logging — Replace Monolog with Database-Backed Logs #747)
  • Replaced all AgentType::CHAT'chat' and AgentType::PIPELINE'pipeline' string literals across 7 files
  • Replaced AgentType::isValid() with inline in_array() check in Chat REST API parameter validation
  • Removed unused AgentType imports from SystemAbilities and test file

What stays

  • PluginSettings::getAgentTypes() — independent utility method for settings UI, not tied to AgentType class
  • Deprecated shims (ToolExecutor::getAvailableTools, ToolManager::getAvailableToolsForChat) — kept one more release cycle, tested by backward compat tests
  • agent_type column in chat sessions table — values stay as string literals ('chat', 'pipeline', 'system')

Testing

  • 785 tests, 0 failures, 3 skipped (pre-existing fixture tests)
  • All syntax checks pass
  • Zero behavioral changes — just removing the indirection layer

Files changed (8 files, +26/-105)

  • AgentType.phpdeleted
  • ChatOrchestrator.php — removed import, 'chat' literals
  • Chat.php (DB) — 11 FQN references → 'chat' literals
  • Chat.php (REST API) — removed import, inline validation
  • CreateChatSessionAbility.php — removed import, 'chat' literal
  • AIStep.php — removed import, 'pipeline' literal
  • SystemAbilities.php — removed unused import
  • SystemAbilitiesTest.php — removed import, 'chat' literal

Completes #741 (all 5 phases done)

Phase 4: Remove the AgentType class entirely. Contexts replace it.

- Delete inc/Engine/AI/AgentType.php (constants PIPELINE/CHAT/SYSTEM/ALL,
  getAll(), isValid(), getLogFilename() — all dead after log modernization)
- Replace AgentType::CHAT with 'chat' string literal (ChatOrchestrator,
  Chat DB, Chat REST API, CreateChatSessionAbility)
- Replace AgentType::PIPELINE with 'pipeline' string literal (AIStep)
- Replace AgentType::isValid() with inline in_array() check (Chat REST API)
- Remove unused AgentType imports from SystemAbilities and test file
- PluginSettings::getAgentTypes() retained — independent utility method
- Deprecated shims (ToolExecutor::getAvailableTools, ToolManager::
  getAvailableToolsForChat) retained for one more release cycle

Zero behavioral changes. 785 tests pass, 0 failures.
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Homeboy Results — data-machine

Lint

Tooling versions

  • Homeboy CLI: homeboy 0.72.0
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

ℹ️ PR test scope resolved to full for compatibility with installed Homeboy CLI

lint (changed files only)

  • PHPCS: LINT SUMMARY: 0 errors, 2 warnings
  • Fixable: 2 | Files with issues: 1 of 6
  • PHPStan: PHPSTAN SUMMARY: 204 errors at level 5

Test

Tooling versions

  • Homeboy CLI: homeboy 0.72.0
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

⚡ PR test scope resolved to changed

test

  • PHPCS: LINT SUMMARY: 65 errors, 58 warnings
  • Fixable: 104 | Files with issues: 19 of 367
Top violations
  WordPress.Arrays.ArrayDeclarationSpacing.ArrayItemNoNewLine    51
  Generic.Formatting.MultipleStatementAlignment.NotSameWarning    33
  WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned    16
  Universal.Operators.DisallowShortTernary.Found              4
  WordPress.DB.PreparedSQL.NotPrepared                        4
- PHPStan: PHPSTAN SUMMARY: 204 errors at level 5 - OK (325 tests, 907 assertions)

Audit

Tooling versions

  • Homeboy CLI: homeboy 0.72.0
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: unknown
  • Action: Extra-Chill/homeboy-action@v1

ℹ️ PR test scope resolved to full for compatibility with installed Homeboy CLI

audit (changed files only)

  • Actionable audit summary:
  • Alignment score: 0.701
  • Severity counts: info: 98, unknown: 76, warning: 284
  • Drift increased: no
  • Outliers in current run: 76
  • Parsed outlier entries: 76
  • Top actionable findings:
    1. inc/Abilities/AgentPingAbilities.php — missing_registration — Missing registration: wp_abilities_api_init
    2. inc/Abilities/EngineAbilities.php — missing_registration — Missing registration: wp_abilities_api_init
    3. inc/Abilities/EngineAbilities.php — missing_interface — Missing interface: PermissionHelper
    4. inc/Abilities/ChatAbilities.php — missing_registration — Missing registration: wp_abilities_api_init
    5. inc/Abilities/ChatAbilities.php — missing_interface — Missing interface: PermissionHelper

Homeboy Action v1

@chubes4 chubes4 merged commit 34b7155 into main Mar 9, 2026
3 checks passed
@chubes4 chubes4 deleted the feature/741-delete-agent-type branch March 9, 2026 02:54
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