Skip to content

feat: allow storing runConfig with ThreadHistoryAdapter #2350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nandev
Copy link

@nandev nandev commented Aug 21, 2025

It would be useful to expose runConfig with ThreadHistoryAdapter so that when persisting a particular message, additional run configuration that is specific to that message would be stored as well.


Important

Enhance message persistence by storing runConfig with ThreadHistoryAdapter and introduce useFallbackId for ID generation.

  • Behavior:
    • Store runConfig with ThreadHistoryAdapter in LocalThreadRuntimeCore.tsx and RemoteThreadListThreadListRuntimeCore.tsx.
    • Introduce useFallbackId function in RemoteThreadListThreadListRuntimeCore.tsx for ID generation.
  • Models:
    • Add runConfig to ExportedMessageRepositoryItem in MessageRepository.tsx.

This description was created by Ellipsis for 9dbb2f6. You can customize this summary. It will automatically update as commits are pushed.

@Copilot Copilot AI review requested due to automatic review settings August 21, 2025 11:01
Copy link

changeset-bot bot commented Aug 21, 2025

⚠️ No Changeset found

Latest commit: 01c58d2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot

This comment was marked as outdated.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

promptless bot commented Aug 21, 2025

📝 Documentation updates detected!

New suggestion: Document runConfig support in ThreadHistoryAdapter

@nandev nandev requested a review from Copilot August 21, 2025 11:14
Copilot

This comment was marked as outdated.

@nandev nandev requested a review from Copilot August 22, 2025 21:01
Copy link
Contributor

@Copilot 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 enables storing run configuration data alongside messages in the ThreadHistoryAdapter, allowing persistence of message-specific configuration settings. This enhancement improves the ability to track and restore the context of individual messages within thread history.

  • Add runConfig field to ExportedMessageRepositoryItem type for storing run configuration with messages
  • Update LocalThreadRuntimeCore to pass runConfig when appending messages to history adapter
  • Include necessary imports for the new RunConfig type

Reviewed Changes

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

File Description
MessageRepository.tsx Adds runConfig field to exported message repository item type and imports RunConfig type
LocalThreadRuntimeCore.tsx Updates message appending logic to include runConfig when available

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -125,6 +125,7 @@ export class LocalThreadRuntimeCore
this._options.adapters.history?.append({
parentId: message.parentId,
message: newMessage,
...(message.runConfig !== undefined && { runConfig: message.runConfig }),
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The conditional spread operator pattern could be simplified. Consider using runConfig: message.runConfig directly since undefined values are typically handled gracefully by the history adapter.

Suggested change
...(message.runConfig !== undefined && { runConfig: message.runConfig }),
runConfig: message.runConfig,

Copilot uses AI. Check for mistakes.

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.

1 participant