Add the terminal output to the chat context#1826
Closed
SoloDevAbu wants to merge 2 commits intoonlook-dev:mainfrom
Closed
Add the terminal output to the chat context#1826SoloDevAbu wants to merge 2 commits intoonlook-dev:mainfrom
SoloDevAbu wants to merge 2 commits intoonlook-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Caution
Changes requested ❌
Reviewed everything up to b5d9f62 in 2 minutes and 39 seconds. Click for details.
- Reviewed
160lines of code in4files - Skipped
0files when reviewing. - Skipped posting
8draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. apps/studio/src/lib/editor/engine/chat/context.ts:129
- Draft comment:
When updating the observable context array in addTerminalContext (lines 129-134), consider using MobX's runInAction to ensure the update is atomic and reactive. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While using runInAction can be a good practice for batching MobX updates, it's not strictly necessary here. The updates are simple and sequential. The class is already properly set up with makeAutoObservable. There's no complex state interaction that would benefit significantly from atomic updates. The current code is clear and works fine. The comment does point out a valid MobX best practice. In some cases, batching updates can improve performance and prevent unnecessary re-renders. However, in this specific case, the benefit would be minimal. The operations are simple, sequential, and the code is already working correctly with MobX's reactivity system. This comment, while technically valid, suggests an optimization that isn't clearly necessary or impactful enough to warrant a code change. It falls into the category of "not clearly requiring a code change."
2. apps/studio/src/routes/editor/EditPanel/ChatTab/ChatInput.tsx:429
- Draft comment:
The onClick handler for the Terminal button calls addTerminalContext without awaiting errors. Consider handling potential promise rejections (e.g., using async/await) to improve error handling. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% 1. The comment assumes addTerminalContext() returns a Promise that could reject, but we don't see the implementation. 2. Without seeing the implementation of addTerminalContext(), we can't verify if error handling is actually needed. 3. The comment is speculative since it's based on assumptions about the function's behavior. 4. The button is already disabled when appropriate via the disabled prop. I could be wrong about addTerminalContext() - maybe it does return a Promise and error handling is important here. The function implementation would clarify this. Without seeing clear evidence that addTerminalContext() returns a Promise or needs error handling, keeping this speculative comment would violate our rule about making speculative comments. Delete this comment since it makes assumptions about error handling needs without clear evidence that the function actually returns a Promise or requires error handling.
3. apps/studio/src/lib/editor/engine/chat/context.ts:7
- Draft comment:
Good addition: TerminalMessageContext is imported along with other context types. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. apps/studio/src/lib/editor/engine/chat/context.ts:48
- Draft comment:
Appending terminalContext to getChatContext is consistent; ensure this ordering meets intended UI logic. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. apps/studio/src/lib/editor/engine/chat/context.ts:129
- Draft comment:
The addTerminalContext method replaces previous terminal contexts before adding a new one. Consider adding error handling or logging if getTerminalContent returns unexpected results. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
6. apps/studio/src/lib/editor/engine/index.ts:353
- Draft comment:
The new getTerminalOutput method safely handles missing runner and errors. Implementation looks good. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
7. apps/studio/src/routes/editor/EditPanel/ChatTab/ChatInput.tsx:429
- Draft comment:
The terminal button triggers addTerminalContext on click. Consider handling the async result or potential rejections for completeness. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
8. packages/models/src/chat/message/context.ts:42
- Draft comment:
TerminalMessageContext re-specifies 'content' and 'displayName' despite inheriting from BaseMessageContext. Consider removing duplicates unless clarity is prioritized. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_guDEAKgcncMgy2Mu
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Contributor
|
Hello, I am migrating the desktop app to a new repository. This repository will now focus on the web version. This PR has been migrated to the new repository: onlook-dev#7. Sorry for the inconvenience, rest assure your work here will also be adapted for the web version (if it hasn't already). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added the terminal message in the chat context
Related Issues
related #1593
Screenshot
Important
Add terminal output to chat context, enabling users to include terminal messages in chat interactions.
ChatContextclass incontext.ts.getTerminalContext()andaddTerminalContext()inChatContextto manage terminal messages.getTerminalOutput()inEditorEngineinindex.tsto fetch terminal history.ChatInput.tsxto trigger terminal output addition to chat context.TERMINALtype toMessageContextTypeincontext.ts.TerminalMessageContexttype incontext.ts.This description was created by
for b5d9f62. You can customize this summary. It will automatically update as commits are pushed.