-
Notifications
You must be signed in to change notification settings - Fork 5
feat: update agent binaries and restart opencode server during sync #155
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
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 |
|---|---|---|
|
|
@@ -607,6 +607,19 @@ export class WorkspaceManager { | |
| } | ||
| } | ||
|
|
||
| private async restartOpenCodeServer(containerName: string): Promise<void> { | ||
| await docker.execInContainer( | ||
| containerName, | ||
| [ | ||
| 'sh', | ||
| '-c', | ||
| 'pkill -f "opencode serve" || true; for i in $(seq 1 20); do pgrep -f "opencode serve" > /dev/null || break; sleep 0.25; done', | ||
| ], | ||
| { user: 'workspace' } | ||
| ); | ||
| await this.startOpenCodeServer(containerName); | ||
| } | ||
|
Comment on lines
+611
to
+621
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. Bug: A race condition in Suggested FixIncrease the timeout in the wait loop from 5 seconds to a more conventional value, such as 10-30 seconds. Additionally, the return value from Prompt for AI Agent |
||
|
|
||
| private async runUserScripts(containerName: string): Promise<void> { | ||
| const scriptPaths = this.config.scripts.post_start; | ||
| if (!scriptPaths || scriptPaths.length === 0) { | ||
|
|
@@ -1221,7 +1234,12 @@ export class WorkspaceManager { | |
| throw new Error(`Workspace '${name}' is not running`); | ||
| } | ||
|
|
||
| await this.setupWorkspaceCredentials(containerName, name, { strictWorker: true }); | ||
| await this.setupWorkspaceCredentials(containerName, name, { | ||
| strictWorker: true, | ||
| startOpenCodeServer: false, | ||
| }); | ||
| await this.updateAgentBinaries(containerName); | ||
| await this.restartOpenCodeServer(containerName); | ||
|
Comment on lines
+1241
to
+1242
This comment was marked as outdated.
Sorry, something went wrong. |
||
| } | ||
|
|
||
| async setPortForwards(name: string, forwards: PortMapping[]): Promise<Workspace> { | ||
|
|
||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.