Skip to content

Implement tracking for when language model session is responding#7

Merged
mattt merged 7 commits intomainfrom
mattt/responding
Oct 28, 2025
Merged

Implement tracking for when language model session is responding#7
mattt merged 7 commits intomainfrom
mattt/responding

Conversation

@mattt
Copy link
Owner

@mattt mattt commented Oct 28, 2025

No description provided.

@mattt mattt requested a review from Copilot October 28, 2025 12:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements tracking for when a language model session is actively responding to requests. The implementation uses a reference-counted state mechanism to handle concurrent requests and updates the isResponding property accordingly.

Key Changes:

  • Converted SystemLanguageModel from a struct to an actor with nonisolated public APIs
  • Added isResponding tracking in LanguageModelSession using a private RespondingState actor for thread-safe reference counting
  • Enhanced Sendable conformance across types to support concurrent operations

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
Sources/AnyLanguageModel/Models/SystemLanguageModel.swift Changed from struct to actor and marked public APIs as nonisolated to maintain existing behavior
Sources/AnyLanguageModel/LanguageModelSession.swift Added responding state tracking with reference counting, wrapping methods for respond/stream operations, and Sendable conformance
Sources/AnyLanguageModel/LanguageModel.swift Added isResponding property to the protocol with a default implementation returning false

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattt mattt requested a review from Copilot October 28, 2025 12:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattt mattt requested a review from Copilot October 28, 2025 12:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattt mattt merged commit 921fedb into main Oct 28, 2025
2 checks passed
@mattt mattt deleted the mattt/responding branch October 28, 2025 12:37
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