Skip to content

Fix inline output schema with unprivileged execution - #147

Open
sylvesterkaczmarek wants to merge 3 commits into
openai:mainfrom
sylvesterkaczmarek:fix/output-schema-unprivileged-user
Open

Fix inline output schema with unprivileged execution#147
sylvesterkaczmarek wants to merge 3 commits into
openai:mainfrom
sylvesterkaczmarek:fix/output-schema-unprivileged-user

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

Fix inline output-schema handling when safety-strategy=unprivileged-user.

The schema temp directory is intentionally created as codexUser with restrictive permissions. The runner previously attempted to write schema.json itself, which fails with EACCES. Cleanup could also fail because the temporary directory belongs to the selected user.

This change:

  • writes inline schema content through sudo -u <codexUser> -- tee, preserving the existing restricted temp-directory ownership
  • cleans user-owned schema directories through privileged cleanup
  • leaves runner-owned and explicit schema paths unchanged
  • adds a regression test using fake sudo and codex executables to exercise the bundled action path
  • rebuilds the checked-in dist/main.js bundle required by CI

Test plan

  • pnpm run check
  • pnpm test
  • pnpm run build
  • confirmed the generated dist/ change is limited to dist/main.js

Fixes #103

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.

output-schema with runAsUser fails to create temporary file

1 participant