Skip to content

feat(execd): support uid and gid for command execution#372

Closed
liuxiaopai-ai wants to merge 1 commit intoalibaba:mainfrom
liuxiaopai-ai:codex/issue-178-command-uid-gid
Closed

feat(execd): support uid and gid for command execution#372
liuxiaopai-ai wants to merge 1 commit intoalibaba:mainfrom
liuxiaopai-ai:codex/issue-178-command-uid-gid

Conversation

@liuxiaopai-ai
Copy link
Contributor

Summary

  • add optional uid and gid fields to execd command requests and OpenAPI schema
  • execute commands with POSIX credentials on non-Windows platforms, while rejecting uid/gid on Windows with a clear error
  • thread the new options through Python, JavaScript, Kotlin/Java, and C# SDK command APIs with focused test updates

Closes #178

Testing

  • cd sdks/sandbox/python && uv run pytest tests/test_converters_and_error_handling.py
  • cd sdks/sandbox/javascript && pnpm build
  • go test ./...
  • cd sdks/sandbox/kotlin && ./gradlew test --tests '*CommandsAdapterTest'
  • dotnet test sdks/sandbox/csharp/tests/OpenSandbox.Tests/OpenSandbox.Tests.csproj --filter "CommandsAdapterTests|ModelsTests"

Notes

  • go is not installed in this environment, so execd Go tests could not be run locally.
  • A Java runtime is not available in this environment, so Kotlin tests could not be run locally.
  • dotnet is not installed in this environment, so C# tests could not be run locally.

Copy link

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

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.

Reviewed commit: 2bbc08246c

ℹ️ 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 +29 to +32
credential := &syscall.Credential{
Uid: uint32(os.Getuid()),
Gid: uint32(os.Getgid()),
}

Choose a reason for hiding this comment

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

P1 Badge Set NoSetGroups when applying POSIX credentials

Creating syscall.Credential without NoSetGroups: true makes Go call setgroups(0, nil) whenever uid/gid is provided, and that fails with operation not permitted in non-root execd deployments even if the requested IDs equal the current user/group. This means the new uid/gid feature can break command start for common hardened setups that run execd as an unprivileged user; please set NoSetGroups (or explicitly manage groups) when building the credential.

Useful? React with 👍 / 👎.

@Pangjiping
Copy link
Collaborator

same as #332

@Pangjiping Pangjiping closed this Mar 6, 2026
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.

FEATURE: support declaring uid and gid when running commands.

2 participants