Skip to content

Commit 6ed242d

Browse files
authored
feat: update agent binaries and restart opencode server during sync (#155)
1 parent 0160e84 commit 6ed242d

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

.github/workflows/mobile-e2e.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
name: Mobile E2E Tests
22

33
on:
4-
push:
5-
branches: [main]
6-
paths:
7-
- 'mobile/**'
8-
pull_request:
9-
branches: [main]
10-
paths:
11-
- 'mobile/**'
124
workflow_dispatch:
13-
schedule:
14-
- cron: '0 9 * * 1' # Monday 9am UTC
155

166
jobs:
177
maestro-ios:

src/workspace/manager.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,19 @@ export class WorkspaceManager {
607607
}
608608
}
609609

610+
private async restartOpenCodeServer(containerName: string): Promise<void> {
611+
await docker.execInContainer(
612+
containerName,
613+
[
614+
'sh',
615+
'-c',
616+
'pkill -f "opencode serve" || true; for i in $(seq 1 20); do pgrep -f "opencode serve" > /dev/null || break; sleep 0.25; done',
617+
],
618+
{ user: 'workspace' }
619+
);
620+
await this.startOpenCodeServer(containerName);
621+
}
622+
610623
private async runUserScripts(containerName: string): Promise<void> {
611624
const scriptPaths = this.config.scripts.post_start;
612625
if (!scriptPaths || scriptPaths.length === 0) {
@@ -1221,7 +1234,12 @@ export class WorkspaceManager {
12211234
throw new Error(`Workspace '${name}' is not running`);
12221235
}
12231236

1224-
await this.setupWorkspaceCredentials(containerName, name, { strictWorker: true });
1237+
await this.setupWorkspaceCredentials(containerName, name, {
1238+
strictWorker: true,
1239+
startOpenCodeServer: false,
1240+
});
1241+
await this.updateAgentBinaries(containerName);
1242+
await this.restartOpenCodeServer(containerName);
12251243
}
12261244

12271245
async setPortForwards(name: string, forwards: PortMapping[]): Promise<Workspace> {

0 commit comments

Comments
 (0)