Repository navigation
Fix guardrails example and add GH diagnostics - #29
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { tool } from "@openai/agents"; | ||
| import type { ToolExecutor, ToolExecutorResult } from "./toolRegistry"; | ||
| import { registerCodexToolExecutor } from "./toolRegistry"; | ||
|
|
||
| type BaseToolOptions = Parameters<typeof tool>[0]; | ||
|
|
||
| export type CodexToolOptions = BaseToolOptions & { | ||
| codexExecute: (input: unknown) => Promise<unknown> | unknown; | ||
| }; | ||
|
|
||
| export function codexTool(options: CodexToolOptions) { | ||
| const { codexExecute, ...delegate } = options; | ||
| const agentTool = tool(delegate as BaseToolOptions); | ||
|
|
||
| const executor = createCodexExecutor(agentTool.name, codexExecute); | ||
| registerCodexToolExecutor(agentTool.name, executor); | ||
|
|
||
| return agentTool; | ||
| } | ||
|
|
||
| function createCodexExecutor(toolName: string, customExecutor: (input: unknown) => Promise<unknown> | unknown): ToolExecutor { | ||
| return async ({ arguments: args }) => { | ||
| const parsedArgs = args ?? {}; | ||
| try { | ||
| const result = await customExecutor(parsedArgs); | ||
| return result as ToolExecutorResult; | ||
| } catch (error) { | ||
| throw new Error(`Codex tool '${toolName}' failed: ${error instanceof Error ? error.message : String(error)}`); | ||
| } | ||
| }; | ||
| } |
There was a problem hiding this comment.
Add runtime dependency on
@openai/agents
The new codexTool helper imports tool from @openai/agents, and the package re‑exports this module from its top‑level index. Because the tsup config treats @openai/agents as an external, Node will attempt to resolve it whenever consumers import @codex-native/sdk. However package.json still lists @openai/agents only as a dev dependency, so downstream projects that do not install it will now hit MODULE_NOT_FOUND at runtime simply by importing the SDK. This is a breaking regression for non‑agents users. Please declare @openai/agents (and friends) as peer/optional dependencies or gate the import behind a dynamic require so the package can load without the extra install.
Useful? React with 👍 / 👎.
- Fix unstable Rust feature usage (once_cell_try) by using stable get_or_init pattern - Fix PathPersistError handling in Linux sandbox initialization - Fix Prettier formatting in tsconfig.pr-worktree.json Resolves CI build-test and sdks job failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Triggering CI checks |
Resolved conflict in pr-worktree-codex.ts by keeping main's fetchRef approach. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Changed the way worktrees are created and updated by using the pull request's head reference directly. - Updated commands to fetch and reset branches, improving clarity and consistency in branch management. - Simplified the push command to directly use the local branch name. These changes enhance the functionality and maintainability of the worktree management process.
- Remove duplicate/broken OnceLock implementation in ensure_embedded_linux_sandbox() - Remove duplicate full_auto field assignment - Remove duplicate cli_full_auto and command variable assignments - Fix duplicate AgentTool type definition - Fix Usage type conversion in CodexProvider streaming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
guardrailpnpm run sdk:build,pnpm --filter @codex-native/sdk run test, and ran the diagnostics example locally