-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: clean up two explicit errors handled elsewhere #138
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -62,15 +62,7 @@ export const ChatView = ({ | |||||||
); | ||||||||
|
||||||||
const handleButtonClick = useCallback(() => { | ||||||||
const lastMessage = messages[messages.length - 1]; | ||||||||
const lastMessageRole = lastMessage.role; | ||||||||
|
||||||||
// if a user has initiated a wallet-based tool call, but not confirmed or denied it | ||||||||
// we don't want to add more messages to the history | ||||||||
const userRequestInProgress = | ||||||||
messages.length > 1 && lastMessageRole === 'user'; | ||||||||
|
||||||||
if (isRequesting || userRequestInProgress) { | ||||||||
Comment on lines
-65
to
-73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now early return from the streaming store if we get into a bad state and don't call the oros/src/toolCallStreamStore.ts Lines 64 to 66 in 1d3f3c4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the reason for the write error in the streaming store is because:
|
||||||||
if (isRequesting) { | ||||||||
onCancel(); | ||||||||
return; | ||||||||
} | ||||||||
|
@@ -90,7 +82,7 @@ export const ChatView = ({ | |||||||
|
||||||||
onSubmit(output); | ||||||||
setInputValue(''); | ||||||||
}, [messages, isRequesting, inputValue, onSubmit, onCancel]); | ||||||||
}, [isRequesting, inputValue, onSubmit, onCancel]); | ||||||||
|
||||||||
const buttonRef = useRef<HTMLButtonElement>(null); | ||||||||
const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => { | ||||||||
|
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.
No longer an error after introducing JSON streaming parser.
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.
Nice cleanup