Skip to content
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

Feat socket io #5056

Merged
merged 127 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
c2a5fbc
Server side work for socketio.
tofarr Nov 13, 2024
2fa8c4e
Initial stab at reimplementing session management
tofarr Nov 13, 2024
5973c0c
Working through socket issues
tofarr Nov 13, 2024
3a59e03
Merge branch 'main' into feat-socket-io
tofarr Nov 13, 2024
18e774d
Fix for merge error
tofarr Nov 13, 2024
92586a0
Server side init is working
tofarr Nov 13, 2024
ca9aefd
WIP - frontend is still janky
tofarr Nov 13, 2024
2501cce
Merge branch 'main' into feat-socket-io
tofarr Nov 13, 2024
d4b20c2
Now using socket io
tofarr Nov 13, 2024
ff7783e
Removed retry - socketio does this anyway
tofarr Nov 14, 2024
8b4d263
Merge branch 'main' into feat-socket-io
tofarr Nov 14, 2024
b85fbf3
Tokens in init event
tofarr Nov 14, 2024
f0487e6
Server side code is working - now on the client side
tofarr Nov 15, 2024
b2bd23a
Fix for test errors - client side seems to work
tofarr Nov 15, 2024
7678785
WIP
tofarr Nov 15, 2024
a1b53a9
Culled dead code
tofarr Nov 15, 2024
511ce8c
Fixed closing
tofarr Nov 15, 2024
3f0e619
WIP
tofarr Nov 15, 2024
2aa6bab
Fix initial startup
tofarr Nov 15, 2024
551a5a7
Client side error fix
tofarr Nov 15, 2024
91447e0
Revert previous fix
tofarr Nov 15, 2024
55da1ca
Removed comment
tofarr Nov 15, 2024
c06f9ce
Frontend fixes
tofarr Nov 15, 2024
9cf4f00
More reconnection fixes
tofarr Nov 15, 2024
c5c3f90
Fix for rehydrate
tofarr Nov 15, 2024
5cff416
Fix
tofarr Nov 15, 2024
a6d2b52
WIP
tofarr Nov 15, 2024
a440260
Merge branch 'main' into feat-socket-io
tofarr Nov 15, 2024
4fac74d
Fixed frontend tests
tofarr Nov 18, 2024
3051dd8
Merge branch 'main' into feat-socket-io
tofarr Nov 18, 2024
a97db52
Lint fixes
tofarr Nov 18, 2024
bc7cb25
Simple redis integration
tofarr Nov 18, 2024
782709d
Merge branch 'main' into feat-socket-io
tofarr Nov 18, 2024
6b2691a
Lint fixes
tofarr Nov 18, 2024
f5ab4bf
Lint fixes
tofarr Nov 18, 2024
02c79c7
Lint fix
tofarr Nov 18, 2024
6698b15
Added redis dependency
tofarr Nov 18, 2024
b10b8fe
WS
tofarr Nov 18, 2024
6ca4629
Merge branch 'main' into feat-socket-io
tofarr Nov 18, 2024
4f5c4a3
Added ability to configure close delay
tofarr Nov 19, 2024
7bccfa7
Merge branch 'main' into feat-socket-io
tofarr Nov 19, 2024
5c3a9cb
Update openhands/server/listen.py
rbren Nov 19, 2024
c49feb4
Updated readme
tofarr Nov 19, 2024
7c4e907
Update openhands/server/listen.py
rbren Nov 19, 2024
cb5d4b9
Update openhands/server/listen.py
rbren Nov 19, 2024
63b367e
delint
rbren Nov 19, 2024
5c978cd
Fixed typo
tofarr Nov 19, 2024
52bbb7a
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 19, 2024
4ba3863
Merge branch 'main' into feat-socket-io
tofarr Nov 19, 2024
7ce72b6
More logging
tofarr Nov 19, 2024
3e12d96
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 19, 2024
29f1ed2
Fix for send
tofarr Nov 19, 2024
a46cea6
Merge branch 'main' into feat-socket-io
tofarr Nov 19, 2024
ec21259
Fix for rate limiter
tofarr Nov 19, 2024
90f59b1
Lint fix
tofarr Nov 19, 2024
9588c42
Merge branch 'main' into feat-socket-io
tofarr Nov 19, 2024
84dd0f2
Temp bump requests
tofarr Nov 19, 2024
e71deb9
Redis integration
tofarr Nov 20, 2024
cc25b36
SIO Fixes
tofarr Nov 21, 2024
3a3668a
Merge branch 'main' into feat-socket-io
tofarr Nov 21, 2024
eb7e8c3
WIP
tofarr Nov 21, 2024
28b9693
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 21, 2024
684be98
WIP
tofarr Nov 21, 2024
373279f
WIP
tofarr Nov 21, 2024
d890b7a
Merge branch 'main' into feat-socket-io
tofarr Nov 21, 2024
6ba7949
Fix for redis error handling
tofarr Nov 21, 2024
5424755
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 21, 2024
8d12295
Merge branch 'main' into feat-socket-io
tofarr Nov 21, 2024
fc400fe
Fix for error on close
tofarr Nov 21, 2024
949f825
Fix for error on close
tofarr Nov 21, 2024
03dba8b
Update frontend/src/context/ws-client-provider.tsx
tofarr Nov 21, 2024
824b7ec
Update openhands/server/session/session.py
tofarr Nov 21, 2024
3615a99
Readme update
tofarr Nov 21, 2024
afc69e6
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 21, 2024
8027f81
Fix for error if local connection not found
tofarr Nov 21, 2024
a68d39b
Fire close
tofarr Nov 21, 2024
1736ebb
Sending message to restart runtime
tofarr Nov 21, 2024
7b2a893
Merge branch 'main' into feat-socket-io
tofarr Nov 21, 2024
70f347c
Lint fix
tofarr Nov 21, 2024
ac21f14
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 21, 2024
13b7219
WIP
tofarr Nov 21, 2024
b7d0e4b
WIP
tofarr Nov 21, 2024
c2cb9c6
Merge branch 'main' into feat-socket-io
tofarr Nov 22, 2024
adf59f5
Merge branch 'main' into feat-socket-io
tofarr Nov 22, 2024
96a07fc
Better debugging
tofarr Nov 22, 2024
52ead62
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 22, 2024
98789d5
Lint fix
tofarr Nov 22, 2024
108765b
Lint fix
tofarr Nov 22, 2024
4f30b38
Fix for list including current directory
tofarr Nov 22, 2024
6799e1a
Merge branch 'main' into feat-socket-io
tofarr Nov 22, 2024
ef1c78a
Lint fixes
tofarr Nov 22, 2024
5d412a7
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 22, 2024
94682d9
More debugging
tofarr Nov 22, 2024
efe3e17
Merge branch 'main' into feat-socket-io
tofarr Nov 22, 2024
7e48df2
Merge branch 'main' into feat-socket-io
tofarr Nov 22, 2024
03f160b
Merge branch 'main' into feat-socket-io
tofarr Nov 22, 2024
174219d
LOG ALL THE THINGS!!!
tofarr Nov 22, 2024
38462d8
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 22, 2024
dd5fc6f
Reorder disconnect
tofarr Nov 22, 2024
0d5dda0
More logging
tofarr Nov 23, 2024
5915a31
More logs
tofarr Nov 23, 2024
512a139
Now querying cluster before starting session
tofarr Nov 23, 2024
c74961a
Merge branch 'main' into feat-socket-io
tofarr Nov 23, 2024
cecac3f
Announcing session closing (When shutdown is graceful)
tofarr Nov 23, 2024
2802a89
Unit tests for manager
tofarr Nov 25, 2024
055a565
Merge branch 'main' into feat-socket-io
tofarr Nov 25, 2024
8325cfb
WIP
tofarr Nov 25, 2024
fca488b
WIP
tofarr Nov 25, 2024
792caea
Merge branch 'main' into feat-socket-io
tofarr Nov 25, 2024
d4ccbd1
Ruff
tofarr Nov 25, 2024
5f575f9
Reorder imports
tofarr Nov 25, 2024
ffb443b
Cleanup fix
tofarr Nov 25, 2024
f8b19cf
More logging on sigterm
tofarr Nov 25, 2024
9b7af2b
Error handling and lint fixes
tofarr Nov 25, 2024
301a63d
Not stopping while running
tofarr Nov 25, 2024
784c704
Lint fixes
tofarr Nov 25, 2024
eb50b13
Implemented suggestion
tofarr Nov 25, 2024
ec21b3a
Reverted remove all containers
tofarr Nov 25, 2024
7a58b0e
Ruff revert
tofarr Nov 25, 2024
b36120c
WIP
tofarr Nov 25, 2024
9c7ce40
WIP
tofarr Nov 25, 2024
9982e94
Merge branch 'main' into feat-socket-io
tofarr Nov 25, 2024
503a553
WIP
tofarr Nov 25, 2024
1469b2a
Update openhands/runtime/impl/remote/remote_runtime.py
rbren Nov 25, 2024
b89d011
Flaky test fix
tofarr Nov 25, 2024
30a205c
Merge branch 'feat-socket-io' of github.com:All-Hands-AI/OpenHands in…
tofarr Nov 25, 2024
56ca2ed
Merge branch 'main' into feat-socket-io
tofarr Nov 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions frontend/__tests__/components/chat/chat-interface.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ChatInterface } from "#/components/chat-interface";
import { addUserMessage } from "#/state/chatSlice";
import { SUGGESTIONS } from "#/utils/suggestions";
import * as ChatSlice from "#/state/chatSlice";
import { WsClientProviderStatus } from "#/context/ws-client-provider";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const renderChatInterface = (messages: (Message | ErrorMessage)[]) =>
Expand All @@ -17,7 +18,7 @@ describe("Empty state", () => {
}));

const { useWsClient: useWsClientMock } = vi.hoisted(() => ({
useWsClient: vi.fn(() => ({ send: sendMock, runtimeActive: true })),
useWsClient: vi.fn(() => ({ send: sendMock, status: WsClientProviderStatus.ACTIVE, isLoadingMessages: false })),
}));

beforeAll(() => {
Expand Down Expand Up @@ -83,8 +84,7 @@ describe("Empty state", () => {
async () => {
// this is to test that the message is in the UI before the socket is called
useWsClientMock.mockImplementation(() => ({
send: sendMock,
runtimeActive: false, // mock an inactive runtime setup
send: sendMock, status: WsClientProviderStatus.ACTIVE, isLoadingMessages: false
}));
const addUserMessageSpy = vi.spyOn(ChatSlice, "addUserMessage");
const user = userEvent.setup();
Expand Down Expand Up @@ -112,8 +112,7 @@ describe("Empty state", () => {
"should send the message to the socket only if the runtime is active",
async () => {
useWsClientMock.mockImplementation(() => ({
send: sendMock,
runtimeActive: false, // mock an inactive runtime setup
send: sendMock, status: WsClientProviderStatus.ACTIVE, isLoadingMessages: false
}));
const user = userEvent.setup();
const { rerender } = renderWithProviders(<ChatInterface />, {
Expand All @@ -122,15 +121,15 @@ describe("Empty state", () => {
},
});


const suggestions = screen.getByTestId("suggestions");
const displayedSuggestions = within(suggestions).getAllByRole("button");

await user.click(displayedSuggestions[0]);
expect(sendMock).not.toHaveBeenCalled();

useWsClientMock.mockImplementation(() => ({
send: sendMock,
runtimeActive: true, // mock an active runtime setup
send: sendMock, status: WsClientProviderStatus.ACTIVE, isLoadingMessages: false
}));
rerender(<ChatInterface />);

Expand Down Expand Up @@ -324,4 +323,4 @@ describe.skip("ChatInterface", () => {
);
it.todo("should render the actions once more after new messages are added");
});
});
});
3 changes: 1 addition & 2 deletions frontend/__tests__/hooks/use-terminal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { render } from "@testing-library/react";
import { afterEach } from "node:test";
import { useTerminal } from "#/hooks/useTerminal";
import { Command } from "#/state/commandSlice";
import { WsClientProvider } from "#/context/ws-client-provider";
import { ReactNode } from "react";

interface TestTerminalComponentProps {
Expand All @@ -26,7 +25,7 @@ interface WrapperProps {

function Wrapper({children}: WrapperProps) {
return (
<WsClientProvider enabled={true} token="NO_JWT" ghToken="NO_GITHUB" settings={null}>{children}</WsClientProvider>
<div>{children}</div>
)
}

Expand Down
80 changes: 80 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"react-textarea-autosize": "^8.5.4",
"remark-gfm": "^4.0.0",
"sirv-cli": "^3.0.0",
"socket.io-client": "^4.8.1",
"tailwind-merge": "^2.5.4",
"vite": "^5.4.9",
"web-vitals": "^3.5.2",
Expand Down
Loading
Loading