Skip to content

Conversation

pakrym-oai
Copy link
Collaborator

Make options not required, add support for working directory and skipGitRepoCheck options on the turn

Change exitCode promise to reject instead of throwing error when child process exits with non-zero code. Update run.test.ts to properly test error handling and remove unnecessary restore call.
@pakrym-oai pakrym-oai changed the title Pakrym/sdk changes SDK: support working directory and skipGitRepoCheck options Oct 1, 2025
resolve(code);
} else {
throw new Error(`Codex Exec exited with code ${code}`);
reject(new Error(`Codex Exec exited with code ${code}: ${stderr}`));
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be useful to surface stderr somehow even when things succeed because there could be warnings printed there that are important?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree but not sure where to put it yet.

if (args.skipGitRepoCheck) {
commandArgs.push("--skip-git-repo-check");
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't comment on the below, but we don't honor OPENAI_BASE_URL or OPENAI_API_KEY anymore, do we?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't comment on line 53, but I would recommend feeding the user's prompt via stdin on the off chance that is extremely large and would exceed PATH_ARG_MAX.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We very much honor OPENAI_BASE_URL that's how all our mock tests work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll look into API key.
Updated to prompt via stdin

- Move user input to stdin for both normal and resume execution
- Refine argument construction for threadId resume
- Capture stderr as Buffer chunks and improve error reporting
- Add error handling for missing stdin
@pakrym-oai pakrym-oai merged commit 8a367ef into main Oct 1, 2025
20 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/sdk-changes branch October 1, 2025 18:26
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants