Skip to content

Add a completion actor with model fallback - #17

Draft
rahamohebbi wants to merge 1 commit into
mainfrom
cursor/completion-actor-e89d
Draft

rahamohebbi wants to merge 1 commit into
mainfrom
cursor/completion-actor-e89d

Conversation

@rahamohebbi

Copy link
Copy Markdown
Owner

Summary

Adds the pieces a product needs to call an actor for text without taking the actor down when Ollama is absent.

  • ITextGenerator, OllamaTextGenerator, and ChainedTextGenerator return a result on network or model failure.
  • CompletionAgent answers a CompletionRequest and uses the request's fallback text when generation fails.
  • AddAgctorHostedRuntime() initializes the in-memory runtime when the host starts.
  • AddAgctor() registers IAgentRegistry, which AgentFactory already required.

Actor model

  • New behavior uses actors / messages rather than shared mutable workflow state (or explains why not)

CompletionAgent only speaks through message envelopes. Generators are dependencies of that actor, not a shared workflow.

Tests

  • Unit tests updated (AgctorSDK.Core.Tests)
  • Integration tests updated when the change crosses process or HTTP/MCP boundaries
  • dotnet build Agctor.sln and the relevant dotnet test projects pass locally

CompletionAgentTests covers direct replies, fallback text, and runtime request-response. Core unit tests: 201 passed. Core integration tests that do not need Ollama: 14 passed, 1 skipped.

Docs and attribution

  • README / XML comments updated if a public API changed
  • CHANGELOG.md Unreleased section updated for user-visible changes
  • No secrets, local config, or build artifacts included
Open in Web Open in Cursor 

Apps can ask CompletionAgent for text and pass fallback copy. AddAgctor now registers the agent registry and can start the runtime with the host.

Co-authored-by: Raha Mohebbi <rahamohebbi@users.noreply.github.com>
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