-
Notifications
You must be signed in to change notification settings - Fork 77
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
[local editor] Don't poll server status when in read only view #1325
Merged
Conversation
This file contains 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
Ankush-lastmile
force-pushed
the
pr1325
branch
2 times, most recently
from
February 23, 2024 18:56
fcd60d0
to
aba8d0b
Compare
Ankush-lastmile
requested review from
saqadri,
rholinshead,
suyoglastmileai,
jonathanlastmileai and
rossdanlm
as code owners
February 23, 2024 18:56
Ankush-lastmile
changed the title
[local editor] Don't poll server status when in read only view
[local editor] Don't poll AIConfig server status when in read only view
Feb 23, 2024
rholinshead
reviewed
Feb 23, 2024
python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx
Outdated
Show resolved
Hide resolved
rholinshead
pushed a commit
that referenced
this pull request
Feb 23, 2024
# [2/n] Support Restarting Editor Server Add an "AIConfig: Restart Active Editor Server" command so that users can restart the server for the active (in-view) editor. As part of this, implement the restart functionality for the EditorServer so that the server process is killed and a new one is started, ensuring the associated extension/webview is properly updated to associate with the new server process. As best effort, also implement an `onDidChangeState` so that we can listen to the editor server status changing and show a progress notification that the server is starting. This logic will be leveraged in subsequent PR to handle restarting all editor servers when the workspace python interpreter changes. https://github.com/lastmile-ai/aiconfig/assets/5060851/39739008-abc7-4538-9087-42972c1400aa Note: The server heartbeat banner shows when restarting because of the existing server status request failing. This should be fixed by #1325 ## Testing: - Restart server and ensure (via logging) that the old one is killed and new one is set up, ensuring prompts run in new one - Close webview and ensure the server is killed - Activate restart server command and toggle away then back to webview, ensure it's in readonly until it starts up and becomes editable again when toggle back
In order to prevent showing status error message when in read only view, this diff makes sure that the aiconfig editor client does not poll the server status when in read only mode. See #1320 for more context ## Testplan 1. Manually set readonly prop to True 2. Load local editor 3. kill the python process that is hosting the aiconfig server. | Before | After | | ------------- | ------------- | | <img width="1913" alt="after" src="https://github.com/lastmile-ai/aiconfig/assets/141073967/ce3487ba-0174-4ca7-b58e-7e10aed6409d"> | <img width="1909" alt="before" src="https://github.com/lastmile-ai/aiconfig/assets/141073967/cba7b817-d09e-435f-b2e8-da7c13109459"> | Note: the `killpython` command in my testplan is a custom alias I have defined that tries to kill all pid's that have the descriptor "python" in its name.
Ankush-lastmile
changed the title
[local editor] Don't poll AIConfig server status when in read only view
[local editor] Don't poll server status when in read only view
Feb 25, 2024
Ankush-lastmile
force-pushed
the
pr1325
branch
from
February 25, 2024 03:21
aba8d0b
to
41ccdad
Compare
note: the aiconfig-editor package needs to be republished in order to validate if #1320 is needed |
UI change for VS Code: Let's have follow up to say "if we're in read-only now, tell them why they can't do changes" -->
|
rossdanlm
approved these changes
Feb 25, 2024
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.
Stamping to unblock, we can follow up more later
rholinshead
added a commit
that referenced
this pull request
Feb 25, 2024
# Update aiconfig-editor to 0.2.2 Includes the changes from #1325 for not polling server status in readonly
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.
[local editor] Don't poll server status when in read only view
In order to prevent showing status error message when in read only view, this diff makes sure that the aiconfig editor client does not poll the server status when in read only mode.
See #1320 for more context
Testplan
Note: the
killpython
command in my testplan is a custom alias I have defined that tries to kill all pid's that have the descriptor "python" in its name.