Skip to content

(feat): Conversation Harness - #23

Merged
WhitWaldo merged 6 commits into
mainfrom
convo-harness
Sep 15, 2026
Merged

WhitWaldo merged 6 commits into
mainfrom
convo-harness

Conversation

@WhitWaldo

Copy link
Copy Markdown
Contributor

Description

Implemented conversation harness.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
@WhitWaldo
WhitWaldo requested a lite review from Copilot September 14, 2026 02:13
@WhitWaldo WhitWaldo self-assigned this Sep 14, 2026
@WhitWaldo WhitWaldo added the enhancement New feature or request label Sep 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical request-shape and endpoint issues, along with lifecycle defects, remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds a conversation-testing harness integrating Dapr with Ollama.

Changes:

  • Adds Ollama container lifecycle and model management.
  • Adds Dapr conversation integration and ConversationHarness.
  • Adds tests, exports, constants, and documentation.
File summaries
File Summary
src/OllamaContainer.ts Ollama container and model utilities
src/OllamaContainer.test.ts Ollama behavior tests
src/index.ts Public API exports
src/DaprContainer.ts Dapr conversation and Ollama integration
src/ConversationHarness.ts Conversation harness implementation
src/ConversationHarness.test.ts Harness and integration tests
src/Constants.ts Ollama defaults
README.md Conversation harness documentation
Review details

Suppressed comments (6)

src/ConversationHarness.ts:209

  • temperature is being serialized as a top-level request field, but Dapr conversation generation settings belong in the parameters object. As a result, the integration test's temperature: 0 (and callers' other convenience values) are ignored or rejected by the sidecar; merge these values into parameters instead of placing them alongside inputs.
    if (options.contextId !== undefined) body.contextId = options.contextId;
    if (options.temperature !== undefined) body.temperature = options.temperature;
    if (options.scrubPii !== undefined) body.scrubPii = options.scrubPii;
    if (options.metadata !== undefined) body.metadata = options.metadata;
    if (options.parameters !== undefined) body.parameters = options.parameters;

src/ConversationHarness.ts:230

  • The method accepts contextId and models a contextId on the response, but only returns the text content here. When Dapr creates a context for the first turn, callers cannot obtain that ID to send the next turn, so the advertised context support cannot be used; return the context ID alongside the content or expose the full response.
    const result = (await response.json()) as ConversationResult;
    const content = result.outputs?.[0]?.choices?.[0]?.message?.content;
    if (content === undefined) {
      throw new Error("Conversation response did not contain message content.");
    }
    return content;

src/ConversationHarness.ts:97

  • The value is validated with trim() by useModel() but the original string is stored and later emitted as component metadata, while OllamaContainer.ensureModel() trims before pulling. For example, useModel(" smollm2:135m ") pulls one model but configures Dapr with a whitespace-padded name, so the component cannot resolve it; normalize the model value before storing it (and apply the same normalization to the constructor option).
    this.modelName = modelName;

src/DaprContainer.ts:175

  • A port-only configuration is inconsistent with the managed container: when ollamaPort is set without ollamaHost or ollamaEndpoint, this branch still creates an Ollama container that listens on/exposes only 11434, while the component is later configured for ollama:<custom-port>/v1 (lines 275-277). Conversations will fail to connect; either reject port-only configuration or make the managed container listen on and expose that port.
      if (!this.ollamaContainer && !this.conversationOptions?.ollamaEndpoint && !this.conversationOptions?.ollamaHost) {
        const container = new OllamaContainer().withNetwork(this.startedNetwork).withNetworkAliases(this.ollamaService);

src/OllamaContainer.ts:134

  • ensureModel("llama3") will not recognize the normal Ollama tag llama3:latest because availability is checked by exact name. That causes an unnecessary pull on every start for valid untagged model names; treat an omitted tag as equivalent to :latest when matching /api/tags.
      const target = model.toLowerCase();
      return (
        data.models?.some((entry) => {
          const names = [entry.name, entry.model].filter((value): value is string => value !== undefined);
          return names.some((name) => name.toLowerCase() === target);

src/OllamaContainer.ts:33

  • A listening TCP port does not guarantee that Ollama's HTTP API is ready. start() immediately calls /api/tags and then possibly /api/pull, so this wait can race server initialization and make harness startup fail with a transient connection/5xx error; wait for an API endpoint such as /api/tags instead.
      .withWaitStrategy(Wait.forListeningPorts())
  • Files reviewed: 8/8 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ConversationHarness.ts
Comment thread src/DaprContainer.ts
Comment thread src/OllamaContainer.ts
Comment thread src/DaprContainer.ts
WhitWaldo and others added 5 commits September 15, 2026 02:25
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…bsHarness

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@WhitWaldo
WhitWaldo merged commit cbc6a2d into main Sep 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants