Skip to content

feat!: remove AgentType, its registry and unused donor-era types (A2a) - #390

Merged
LinuxDevil merged 1 commit into
mainfrom
lou-a2a-remove-agenttype
Oct 4, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
lou-a2a-remove-agenttype

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Closes #237

Stacked on #387 (lou-a1-subpaths) — merge order: A1 → this PR → A2b → A2c → A3 → A5.

What this removes (25 root exports)

  • src/agent-types/ (index, registry, validators) and its export * from the root: agentTypesRegistry, getAgentTypeDescriptor, getAllAgentTypeDescriptors, isValidAgentType, validateAgentConfig, validateAgentTools.
  • src/types/repository.ts: IRepository, IAgentRepository, SessionData, ISessionRepository, ResultData, IResultRepository, SDKRepositories.
  • src/types/common.ts: DataLoadingStatus, PaginationParams, PaginatedResponse, DeepPartial, Timestamped, IdEntity.
  • src/types/agent.ts: AgentType, AgentTypeDescriptor, AgentConfig.agentType, AgentExecutionOptions, AgentExecutionResult, AgentDefinition, ToolSetting (+ the now-unused Message import).
  • AgentBuilder: setType(), the persisted agentType field, and the registry-validator imports.

Export counts (TypeScript checker over each entry point)

  • Root src/index.ts: 727 → 702 (exactly −25).
  • ./types src/types/index.ts: 32 → 13 (exactly −19 type names from types/ files).

Spec decisions exercised

  • The two live checks moved verbatim into AgentBuilder's private validate(): the missing-name error (Agent name is required. Example: AgentBuilder.create().setName('my-agent')...build()) and the missing-tool error (Tool configuration for '<key>' is missing 'tool' property), both under LOUSHO_VALIDATION_FAILED. Only the dead agentType check inside validateAgentConfig was dropped.
  • AgentConfig.flows?: AgentFlow[] kept (A1 moved flows, did not remove them).
  • No migration added for persisted data: agentType was optional, so old checkpoints/approval snapshots still load and the field is ignored (noted in the changelog).
  • Each removed name was re-grepped before deletion; the only users were the five test/fixture files named in the issue.
  • All 25 removed names pinned in src/publicSurface.test-d.ts as @ts-expect-error off the root; the 8 runtime values (6 registry/validators + AgentType + DataLoadingStatus enums) pinned absent in src/publicSurface.test.ts.

Ambiguities resolved / deviations

  • The acceptance grep grep -rn "AgentType\b\|agentType" src apps/agent-forge examples docs/*.md README.md matches only src/publicSurface.test.ts / src/publicSurface.test-d.ts — the spec itself requires the removed names to appear there as pins asserting their absence, so those two files are the only hits by design. Everything else (source, apps, examples, docs, README) is clean; docs/research/feature-audit.md is outside the grep's docs/*.md glob and was left alone as a historical audit document.
  • AgentBuilder.test.ts: deleted the two agent-type-only cases (setType round trip, agentType: 'bogus'), renamed builds without setType() to builds an agent with a name only, and added one case asserting the tool-less tool entry still throws LOUSHO_VALIDATION_FAILED (covers the acceptance criterion that both validations keep firing).
  • The issue's owner question ("May A2a delete AgentType ... in the next alpha?") has no recorded answer; proceeded because every removed symbol was already @deprecated or unused and this is a pre-1.0 alpha.
  • npm run pack-smoke fails only on the pre-existing tarball size caps (919 entries vs max 900; 16,949,834 vs 16,777,216 bytes unpacked — improved from 924 / 16,997,702 by the deletions). All functional pack checks pass (19/19 ESM + CJS entries load, createAgent + mockModel turn ok, CLI + tsc resolution ok). Tracked separately on fix/lou-s1-tarball.

Verification

  • npm run build ✅ (incl. DTS)
  • npx vitest run ✅ 296 files / 4,278 tests
  • npm run test:types ✅ 18 files / 83 tests, no type errors
  • npm run test:evals:judge ✅
  • npm run lint ✅, npm run typecheck ✅
  • npm run docs:llms regenerated (llms.txt unchanged, llms-full.txt updated); npm run docs:verify-snippets -- --skip-build ✅ 258 snippets
  • Agent Forge: typecheck ✅, typecheck:server ✅, client tests 119 ✅, server tests 133 ✅
  • npm run pack-smoke ⚠️ pre-existing size-cap failure only (see above)

Remove 25 root exports that had no runtime effect or no implementation:

- src/agent-types/ (index, registry, validators) and its root re-export
- src/types/repository.ts and src/types/common.ts (no users)
- types/agent.ts: AgentType, AgentTypeDescriptor, AgentConfig.agentType,
  AgentExecutionOptions, AgentExecutionResult, AgentDefinition, ToolSetting
- AgentBuilder: setType(), the persisted agentType field, and the
  registry-validator imports; the name/tool checks move inline into
  validate() with the same messages and LOUSHO_VALIDATION_FAILED code

Checkpoints saved with agentType still load; the field is ignored.

Closes #237
@LinuxDevil
LinuxDevil force-pushed the lou-a2a-remove-agenttype branch from 667e08a to 75c99cb Compare October 4, 2026 12:41
@LinuxDevil
LinuxDevil changed the base branch from lou-a1-subpaths to main October 4, 2026 12:42
@LinuxDevil
LinuxDevil merged commit 4d0046b into main Oct 4, 2026
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.

[A2a] Remove AgentType, its registry, repository interfaces and unused donor types

1 participant