fix(codex): send selected skills as structured turn input #9290
Closedkopenkinda(GitHub profile, opens in a new tab)wants to merge 10 commits into
main fromrefs/pull/9290/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/server/src/provider/Layers/CodexSessionRuntime.ts line 734OutdatedResolvedby kopenkinda(GitHub profile, opens in a new tab)@@ -649,0 +714,21 @@714+ return resolved;715+}716+717+export const startCodexTurn = Effect.fn("CodexSessionRuntime.startCodexTurn")(function* (input: {718+ readonly client: CodexTurnStartClient;719+ readonly cwd: string;720+ readonly turn: BuildTurnStartParamsInput;721+}) {722+ let skills: ReadonlyArray<ResolvedCodexSkill> = [];723+ const prompt = input.turn.prompt;724+ if (prompt && collectExplicitCodexSkillNames(prompt).length > 0) {725+ const catalog = yield* input.client.request("skills/list", { cwds: [input.cwd] }).pipe(726+ Effect.catch((cause) =>727+ Effect.logWarning("Unable to resolve explicit Codex skills before turn.", {728+ cause,729+ cwd: input.cwd,730+ }).pipe(Effect.as(undefined)),731+ ),732+ );733+ const cwdSkills = catalog?.data.find((entry) => entry.cwd === input.cwd)?.skills ?? [];734+ skills = resolveCodexSkillInputs(prompt, cwdSkills);
- apps/server/src/provider/Layers/CodexSessionRuntime.ts line 724OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -650,0 +704,21 @@704+ const seenNames = new Set<string>();705+ for (const name of collectExplicitCodexSkillNames(prompt)) {706+ const skill = enabledSkillsByName.get(name);707+ if (!skill || seenNames.has(name)) {708+ continue;709+ }710+ seenNames.add(name);711+ resolved.push(skill);712+ }713+ return resolved;714+}715+716+export const startCodexTurn = Effect.fn("CodexSessionRuntime.startCodexTurn")(function* (input: {717+ readonly client: CodexTurnStartClient;718+ readonly cwd: string;719+ readonly turn: Omit<BuildTurnStartParamsInput, "skills">;720+}) {721+ let skills: ReadonlyArray<ResolvedCodexSkill> = [];722+ const prompt = input.turn.prompt;723+ if (prompt && collectExplicitCodexSkillNames(prompt).length > 0) {724+ const catalog = yield* input.client.request("skills/list", { cwds: [input.cwd] }).pipe(
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
kopenkinda(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


cursor[bot](GitHub profile, opens in a new tab) reviewed
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3ecb520e1fa35f6fa16f37e3428272a7e482e423. Configure [here](https://www.cursor.com/dashboard/bugbot).