-
Notifications
You must be signed in to change notification settings - Fork 661
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
base: main
Are you sure you want to change the base?
feat: allow storing runConfig with ThreadHistoryAdapter #2350
Conversation
|
There was a problem hiding this 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
packages/react/src/runtimes/remote-thread-list/RemoteThreadListThreadListRuntimeCore.tsx
Outdated
Show resolved
Hide resolved
📝 Documentation updates detected! New suggestion: Document runConfig support in ThreadHistoryAdapter |
There was a problem hiding this 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 toExportedMessageRepositoryItem
type for storing run configuration with messages - Update
LocalThreadRuntimeCore
to passrunConfig
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 }), |
There was a problem hiding this comment.
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.
...(message.runConfig !== undefined && { runConfig: message.runConfig }), | |
runConfig: message.runConfig, |
Copilot uses AI. Check for mistakes.
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
withThreadHistoryAdapter
and introduceuseFallbackId
for ID generation.runConfig
withThreadHistoryAdapter
inLocalThreadRuntimeCore.tsx
andRemoteThreadListThreadListRuntimeCore.tsx
.useFallbackId
function inRemoteThreadListThreadListRuntimeCore.tsx
for ID generation.runConfig
toExportedMessageRepositoryItem
inMessageRepository.tsx
.This description was created by
for 9dbb2f6. You can customize this summary. It will automatically update as commits are pushed.