Skip to content

Conversation

@bfollington
Copy link
Contributor

@bfollington bfollington commented Oct 27, 2025

  • Refactor LLM tool aggregation
  • Fix types
  • Further cleanup

Summary by cubic

Consolidated LLM tool aggregation and tool-call execution in llm-dialog.ts to simplify charm tool handling and improve type safety. This reduces duplicated logic and makes read/run charm tools more predictable.

  • Refactors

    • Added ToolCatalog and collectToolEntries to centralize tool discovery.
    • Generated consistent read/run charm tools via createCharmToolDefinitions.
    • Extracted tool-call flow into resolveToolCall, executeToolCalls, createToolResultMessages, and buildAssistantMessage.
    • Normalized input parsing with normalizeCharmPathSegments and extractRunArguments.
    • Simplified flattenTools and startRequest by using buildToolCatalog.
  • Bug Fixes

    • Clear errors when paths resolve to handler streams (read) or not (run).
    • Consistent charm schema selection (loaded recipe or minimal fallback).
    • Correct handling of args provided under input.args or as top-level fields.
    • More robust resolution of legacy vs aggregated tools; informative error on unknown tools.

@bfollington bfollington requested a review from seefeldb October 27, 2025 04:51
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@bfollington bfollington merged commit 129a66d into main Oct 27, 2025
8 checks passed
@bfollington bfollington deleted the feat/2025-10-27-clean-up-llm-dialog branch October 27, 2025 22:47
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