Skip to content

Fix guardrails example and add GH diagnostics - #29

Merged
ScriptedAlchemy merged 11 commits into
mainfrom
feat/native-binding-reorg
Nov 7, 2025
Merged

ScriptedAlchemy merged 11 commits into
mainfrom
feat/native-binding-reorg

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • add a fallback guardrail helper so the example runs on agents builds that do not export guardrail
  • refresh the GitHub network diagnostic script and log command outputs to spot TLS/cert issues faster
  • verified with pnpm run sdk:build, pnpm --filter @codex-native/sdk run test, and ran the diagnostics example locally

@changeset-bot

changeset-bot Bot commented Nov 7, 2025 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 563875d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1 to +31
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)}`);
}
};
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge 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 👍 / 👎.

ScriptedAlchemy and others added 4 commits November 7, 2025 00:05
- 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>
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Triggering CI checks

ScriptedAlchemy and others added 4 commits November 7, 2025 11:56
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>
@ScriptedAlchemy
ScriptedAlchemy merged commit c28f9ce into main Nov 7, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant