mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-08 07:17:39 +00:00
fix(codex): expose HAPI threads to Codex Desktop (#1022)
* test(codex): reproduce desktop thread classification gap * fix(codex): classify HAPI threads as user sessions * test(codex): cover thread source creation paths
This commit is contained in:
@@ -98,6 +98,7 @@ const TRUSTED_ACCESS_FOR_CYBER_URL = 'https://chatgpt.com/cyber';
|
||||
const CYBER_POLICY_TRUSTED_ACCESS_URL = 'https://openai.com/form/enterprise-trusted-access-for-cyber/';
|
||||
const CODEX_GOALS_UNSUPPORTED_MESSAGE = 'Codex goals are not supported by this Codex runtime. Upgrade Codex or enable features.goals.';
|
||||
const MAX_CODEX_GOAL_OBJECTIVE_CHARS = 4_000;
|
||||
const HAPI_TOP_LEVEL_THREAD_SOURCE = 'user';
|
||||
|
||||
type GoalForwardSignature = {
|
||||
objective: string | null;
|
||||
@@ -3338,7 +3339,10 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
|
||||
mcpServers,
|
||||
cliOverrides: session.codexCliOverrides
|
||||
});
|
||||
const threadResponse = await appServerClient.startThread(threadParams, {
|
||||
const threadResponse = await appServerClient.startThread({
|
||||
...threadParams,
|
||||
threadSource: HAPI_TOP_LEVEL_THREAD_SOURCE
|
||||
}, {
|
||||
signal: this.abortController.signal
|
||||
});
|
||||
const threadRecord = asRecord(threadResponse);
|
||||
@@ -3597,7 +3601,10 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
|
||||
}
|
||||
|
||||
if (!threadId) {
|
||||
const threadResponse = await appServerClient.startThread(threadParams, {
|
||||
const threadResponse = await appServerClient.startThread({
|
||||
...threadParams,
|
||||
threadSource: HAPI_TOP_LEVEL_THREAD_SOURCE
|
||||
}, {
|
||||
signal: this.abortController.signal
|
||||
});
|
||||
const threadRecord = asRecord(threadResponse);
|
||||
|
||||
Reference in New Issue
Block a user