Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion launcher/electron/browser-host.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1119,15 +1119,22 @@ class BrowserHost {
this.manualOperation = name;
const contents = this.view?.webContents;
if (contents && !contents.isDestroyed()) contents.setBackgroundThrottling(false);
let succeeded = false;
try {
return await action();
const result = await action();
succeeded = true;
return result;
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
this.setState({ status: "error", message });
throw error;
} finally {
if (contents && !contents.isDestroyed()) contents.setBackgroundThrottling(true);
this.manualOperation = null;
if (succeeded && !this.activeTraceId && this.state.authenticated
&& ["loading", "running", "testing"].includes(this.state.status)) {
this.setState({ status: "ready", message: "ChatGPT is ready" });
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion launcher/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codex-web-gpt-launcher",
"version": "1.0.1-ko.2",
"version": "1.0.1-ko.3",
"private": true,
"description": "Desktop control center for Codex ChatGPT Web",
"author": "miuuyy; Korean localization by AgenticLab-SH",
Expand Down
37 changes: 36 additions & 1 deletion launcher/tests/browser-host.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,15 @@ test("launcher session refresh resolves persisted authentication before setup ac

test("manual browser operations disable background throttling until completion", async () => {
const throttling = [];
const states = [];
const fixture = {
activeTraceId: null,
manualOperation: null,
setState() {},
state: { authenticated: true, status: "loading" },
setState(patch) {
states.push(patch);
this.state = { ...this.state, ...patch };
},
view: {
webContents: {
isDestroyed: () => false,
Expand All @@ -694,6 +699,36 @@ test("manual browser operations disable background throttling until completion",

assert.equal(result, "ok");
assert.deepEqual(throttling, [false, true]);
assert.deepEqual(states, [{ status: "ready", message: "ChatGPT is ready" }]);
assert.equal(fixture.manualOperation, null);
});

test("failed manual browser operations preserve their error state", async () => {
const states = [];
const fixture = {
activeTraceId: null,
manualOperation: null,
state: { authenticated: true, status: "loading" },
setState(patch) {
states.push(patch);
this.state = { ...this.state, ...patch };
},
view: {
webContents: {
isDestroyed: () => false,
setBackgroundThrottling() {},
},
},
};

await assert.rejects(
BrowserHost.prototype.withManualOperation.call(fixture, "failing check", async () => {
throw new Error("failed check");
}),
/failed check/,
);

assert.deepEqual(states, [{ status: "error", message: "failed check" }]);
assert.equal(fixture.manualOperation, null);
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codex-chatgpt-web",
"version": "1.0.1-ko.2",
"version": "1.0.1-ko.3",
"private": true,
"description": "A focused local Responses bridge that runs Codex tasks through a user-authenticated ChatGPT web session.",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eu

REPOSITORY="${CODEX_CHATGPT_WEB_REPOSITORY:-AgenticLab-SH/codex-chatgpt-web}"
VERSION="${CODEX_CHATGPT_WEB_VERSION:-1.0.1-ko.2}"
VERSION="${CODEX_CHATGPT_WEB_VERSION:-1.0.1-ko.3}"
BIN_DIR="${CODEX_CHATGPT_WEB_BIN_DIR:-$HOME/.local/bin}"
LIB_DIR="${CODEX_CHATGPT_WEB_LIB_DIR:-$HOME/.local/lib/codex-chatgpt-web}"
DOC_DIR="${CODEX_CHATGPT_WEB_DOC_DIR:-$HOME/.local/share/doc/codex-chatgpt-web}"
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = "1.0.1-ko.2";
export const VERSION = "1.0.1-ko.3";