mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-15 19:52:50 +03:00
* fix(deps): bump nanoid, dompurify for 2 new Dependabot alerts (#189, #190) Bumps: nanoid ^3.3.17 (was transitive, now overridden), dompurify ^3.4.13 (with monaco-editor scoped override). Closes Dependabot #189, #190. Remaining #182-#188 (js-yaml + mermaid) already closed by #9651 merge — awaiting Dependabot re-scan. npm audit → 0 vulnerabilities. * fix(repo): harden .gitignore to also ignore a _tasks symlink (/_tasks) _tasks is a SEPARATE nested git repo (gitignored). The pattern _tasks/ (trailing slash) ignores only a directory, not a SYMLINK named _tasks. A self-referential _tasks symlink can slip in via git add -A and, once pulled, checkout materializes it over the real _tasks repo (destroying plans/specs/hands-off). Anchored /_tasks ignores the symlink too, preventing re-capture. * feat(codex): converge OAuth fingerprints * test(codex): preserve identity assertions * fix(codex): preserve explicit off identity * fix(codex): close fingerprint transport gaps --------- Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@outlook.com> Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
60 lines
2.0 KiB
TypeScript
60 lines
2.0 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import fs from "node:fs";
|
|
import os from "node:os";
|
|
import path from "node:path";
|
|
|
|
const TEST_DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), "omniroute-codex-ws-fingerprint-"));
|
|
process.env.DATA_DIR = TEST_DATA_DIR;
|
|
process.env.APP_LOG_TO_FILE = "false";
|
|
process.env.OMNIROUTE_WS_BRIDGE_SECRET = "bridge-secret";
|
|
|
|
const core = await import("../../src/lib/db/core.ts");
|
|
const { createProviderConnection } = await import("../../src/lib/db/providers.ts");
|
|
const { POST } = await import("../../src/app/api/internal/codex-responses-ws/route.ts");
|
|
|
|
function resetDb() {
|
|
core.resetDbInstance();
|
|
fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true });
|
|
fs.mkdirSync(TEST_DATA_DIR, { recursive: true });
|
|
}
|
|
|
|
test.beforeEach(resetDb);
|
|
test.after(() => {
|
|
core.resetDbInstance();
|
|
fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true });
|
|
});
|
|
|
|
test("Codex internal websocket bridge prepare preserves original OAuth identity in off mode", async () => {
|
|
await createProviderConnection({
|
|
provider: "codex",
|
|
authType: "oauth",
|
|
name: "Codex WS off",
|
|
accessToken: "oauth-token",
|
|
isActive: true,
|
|
testStatus: "active",
|
|
providerSpecificData: { codexFingerprintMode: "off" },
|
|
});
|
|
|
|
const response = await POST(
|
|
new Request("http://omniroute.local/api/internal/codex-responses-ws", {
|
|
method: "POST",
|
|
headers: {
|
|
"content-type": "application/json",
|
|
"x-omniroute-ws-bridge-secret": "bridge-secret",
|
|
},
|
|
body: JSON.stringify({
|
|
action: "prepare",
|
|
requestUrl: "http://omniroute.local/v1/responses",
|
|
headers: { "session-id": "client-session", "thread-id": "client-thread" },
|
|
response: { model: "codex/gpt-5.5", input: "hello" },
|
|
}),
|
|
})
|
|
);
|
|
const body = await response.json();
|
|
|
|
assert.equal(response.status, 200, JSON.stringify(body));
|
|
assert.equal(body.headers["session-id"], "client-session");
|
|
assert.equal(body.headers["thread-id"], "client-thread");
|
|
});
|