Skip to content

Commit e6ea971

Browse files
committed
Enable concurrent server actions
1 parent be52bd9 commit e6ea971

3 files changed

Lines changed: 53 additions & 10 deletions

File tree

crash.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
~/projects/js/codex_manager ❯❯ zig build dev --
2+
vite v7.3.1 building client environment for production...
3+
✓ 8 modules transformed.
4+
dist/index.html 0.49 kB │ gzip: 0.33 kB
5+
dist/assets/app.css 14.24 kB │ gzip: 3.76 kB
6+
dist/assets/app.js 61.58 kB │ gzip: 19.05 kB
7+
✓ built in 453ms
8+
Codex Manager desktop URL: http://127.0.0.1:14555/index.html
9+
Segmentation fault at address 0x28
10+
???:?:?: 0x7fcd2a705a1e in ??? (libglib-2.0.so.0)
11+
Unwind information for `libglib-2.0.so.0:0x7fcd2a705a1e` was not available, trace may be incomplete
12+
13+
???:?:?: 0x7fcd2acfc212 in ??? (libgtk-3.so.0)
14+
/home/a/.cache/zig/p/webui-2.5.0-beta.4-pxqD5Rb7NwBVEwKyEzxwKAprzUIYjN20Y_Wffl_SWVdg/src/webui.c:12173:17: 0x129553c in _webui_wv_set_position (/home/a/.cache/zig/p/webui-2.5.0-beta.4-pxqD5Rb7NwBVEwKyEzxwKAprzUIYjN20Y_Wffl_SWVdg/src/webui.c)
15+
gtk_window_move(webView->gtk_win, webView->x, webView->y);
16+
^
17+
/home/a/.cache/zig/p/webui-2.5.0-beta.4-pxqD5Rb7NwBVEwKyEzxwKAprzUIYjN20Y_Wffl_SWVdg/src/webui.c:12669:25: 0x129497c in _webui_webview_thread (/home/a/.cache/zig/p/webui-2.5.0-beta.4-pxqD5Rb7NwBVEwKyEzxwKAprzUIYjN20Y_Wffl_SWVdg/src/webui.c)
18+
_webui_wv_set_position(win->webView, win->webView->x, win->webView->y);
19+
^
20+
???:?:?: 0x7fcd2b3c9979 in ??? (libc.so.6)
21+
???:?:?: 0x7fcd2b44d2bb in ??? (libc.so.6)
22+
dev
23+
└─ run exe codex-manager failure
24+
error: the following command terminated unexpectedly:
25+
./.zig-cache/o/ac1f3594cb029bd37a71e0f582a44df6/codex-manager
26+
27+
Build Summary: 7/9 steps succeeded; 1 failed
28+
dev transitive failure
29+
└─ run exe codex-manager failure
30+
31+
error: the following build command failed with exit code 1:
32+
.zig-cache/o/8d1b01c57edb2b5cd0be174e9e1fd3ce/build /home/a/.local/bin/zig /home/a/.local/lib/zig /home/a/projects/js/codex_manager .zig-cache /home/a/.cache/zig --seed 0xe4725bbb -Z17307fc56fbdf828 dev --

frontend/src/App.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ body.drag-select-lock * {
175175

176176
.topbar-main {
177177
min-width: 0;
178-
cursor: grab;
179-
-webkit-app-region: drag;
180-
--webui-app-region: drag;
181-
app-region: drag;
182178
}
183179

184180
button,

src/main.zig

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var window_is_fullscreen: bool = false;
2727
var window_state_lock = std.Thread.Mutex{};
2828
var oauth_listener_cancel = std.atomic.Value(bool).init(false);
2929
var active_bundle: assets.Bundle = .web;
30+
var show_custom_window_bar = false;
3031
var templates_initialized = false;
3132
var index_template: ?IndexTemplate = null;
3233

@@ -72,22 +73,35 @@ pub fn main() !void {
7273

7374
if (force_web_mode) {
7475
active_bundle = .web;
76+
show_custom_window_bar = false;
7577
std.debug.print("Codex Manager web mode URL: {s}\n", .{loopback_url});
7678
webui.openUrl(loopback_url_z);
7779
} else {
7880
// Default mode is desktop; if WebView dependencies are unavailable, fall back to browser.
7981
active_bundle = .desktop;
80-
window.setFrameless(true);
82+
// Linux WebUI drag/minimize/maximize in frameless mode is unstable upstream.
83+
// Keep native OS chrome there; use custom HTML chrome on other desktop OSes.
84+
const use_custom_window_chrome = builtin.os.tag != .linux;
85+
show_custom_window_bar = use_custom_window_chrome;
86+
if (!use_custom_window_chrome) {
87+
std.debug.print("Linux desktop: using native window chrome (frameless drag is unstable in current WebUI build)\n", .{});
88+
}
89+
if (use_custom_window_chrome) {
90+
window.setFrameless(true);
91+
}
8192
window.setCloseHandlerWv(cmWindowCloseHandler);
8293

83-
_ = try window.bind("cm_window_minimize", cmWindowMinimize);
84-
_ = try window.bind("cm_window_toggle_fullscreen", cmWindowToggleFullscreen);
85-
_ = try window.bind("cm_window_is_fullscreen", cmWindowIsFullscreen);
86-
_ = try window.bind("cm_window_close", cmWindowClose);
94+
if (use_custom_window_chrome) {
95+
_ = try window.bind("cm_window_minimize", cmWindowMinimize);
96+
_ = try window.bind("cm_window_toggle_fullscreen", cmWindowToggleFullscreen);
97+
_ = try window.bind("cm_window_is_fullscreen", cmWindowIsFullscreen);
98+
_ = try window.bind("cm_window_close", cmWindowClose);
99+
}
87100

88101
std.debug.print("Codex Manager desktop URL: {s}\n", .{loopback_url});
89102
window.showWv(loopback_url_z) catch |err| {
90103
active_bundle = .web;
104+
show_custom_window_bar = false;
91105
std.debug.print(
92106
"Desktop WebView unavailable ({s}); falling back to browser mode at {s}\n",
93107
.{ @errorName(err), loopback_url },
@@ -238,7 +252,8 @@ fn makeDynamicIndexResponse(bundle: assets.Bundle) ?[]const u8 {
238252

239253
const state_json = loadBootstrapStateJson(allocator) catch return null;
240254
defer allocator.free(state_json);
241-
const show_window_bar = bundle == .desktop;
255+
_ = bundle;
256+
const show_window_bar = show_custom_window_bar;
242257

243258
const injected_state_json = blk: {
244259
var parsed = std.json.parseFromSlice(std.json.Value, allocator, state_json, .{}) catch {

0 commit comments

Comments
 (0)