Skip to content

Migrate capabilities to RockBot.A2A IAgentSkillHandler once MarimerLLC/rockbot#283 ships #5

@rockfordlhotka

Description

@rockfordlhotka

Context

Foragent introduced ICapability + ForagentTaskHandler (a DI-resolved dispatcher) in step 3 to grow the skill surface without the single-handler-per-agent pattern that the RockBot framework provides today via IAgentTaskHandler.

Upstream tracking: MarimerLLC/rockbot#283 proposes moving that dispatch pattern into the framework as IAgentSkillHandler + AddSkillHandler<T>(), with the framework auto-wiring IAgentTaskHandler and auto-populating AgentCard.Skills.

When rockbot#283 ships (estimated RockBot 0.9.x), Foragent should migrate to it.

What to delete once the framework supports it

  • src/Foragent.Capabilities/ICapability.cs
  • src/Foragent.Capabilities/ForagentTaskHandler.cs (dispatcher — framework replaces it)
  • src/Foragent.Capabilities/ForagentCapabilitiesServiceCollectionExtensions.cs — replaced by individual AddSkillHandler<T>() calls
  • ForagentCapabilities.Skills static array — framework will derive the card from registered handlers
  • tests/Foragent.Agent.Tests/ForagentTaskHandlerTests.cs — tests the dispatcher we're deleting

What to change

  • FetchPageTitleCapability and ExtractStructuredDataCapability implement IAgentSkillHandler instead of ICapability. The existing SkillDefinition / ExecuteAsync signatures are already identical in spirit, so the rename should be mechanical.
  • src/Foragent.Agent/Program.cs — replace agent.Services.AddForagentCapabilities() with two agent.AddSkillHandler<T>() calls; remove the manual opts.Card.Skills = [..ForagentCapabilities.Skills] assignment and the matching opts.Skills = [..] override on AddA2AHttpGateway (framework populates both sides of the card from the registered handlers).
  • src/Foragent.Agent/appsettings.jsonGateway:Skills can be removed entirely if it hasn't been already (it's already effectively ignored since we override at startup).

Acceptance

  • Both capabilities still pass their unit tests (mocking the browser + LLM as they do today) after the migration — the ExecuteAsync method body doesn't need to change.
  • The docker-compose smoke path (Blazor → RockBot → Foragent over A2A) still returns the same results for both fetch-page-title and extract-structured-data.
  • docs/framework-feedback.md gets a "Step 3 observation resolved" note linking to the delivered rockbot PR.

Do not do before upstream ships

The migration is a no-op until RockBot.A2A exposes IAgentSkillHandler. Pin this to the first RockBot release that includes rockbot#283; don't try to emulate the shape in-repo first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions