Skip to content

Sync fork with ultraworkers/claw-code:main - #9

Merged
niStee merged 5 commits into
mainfrom
sync/upstream-20260806-231830
Aug 6, 2026
Merged

Sync fork with ultraworkers/claw-code:main#9
niStee merged 5 commits into
mainfrom
sync/upstream-20260806-231830

Conversation

@fork-sync-approver

Copy link
Copy Markdown

Automated pull-based sync from ultraworkers/claw-code.

Handoff to human: GitHub blocks any identity from approving its own PR, so the workflow cannot auto-approve. Please click Approve then Merge when you're ready.

(This is the Dependabot-style pattern: the workflow opens the PR, you approve and merge. No credentials required.))
Automated sync uses GitHub App installation token for PR creation only.

procaffe121 and others added 5 commits July 31, 2026 17:08
No behavior change. Move the inline probe out of
unshare_user_namespace_works into a reusable unshare_probe helper and a
cached working_unshare_mapping() that picks the first working candidate
from UNSHARE_MAPPING_CANDIDATES, so the launcher and the capability probe
share one code path.
…icted

Plain `unshare --user --map-root-user` fails on kernels and containers
that block unprivileged writes to /proc/self/uid_map (e.g. GitHub Actions,
restricted AppArmor profiles). On those systems util-linux delegates to the
setuid newuidmap/newgidmap helpers when --map-auto is also present.

Add the combined form as a fallback candidate and build the launcher args
from the probed mapping, so systems without newuidmap/newgidmap or a
/etc/subuid range keep using the plain form.
… fallback

The fallback candidate relies on the setuid newuidmap/newgidmap helpers
(uidmap package) plus a subuid/subgid range for the current user. Note in
the candidate docs that the startup probe rejects the candidate when those
are missing, so the plain --map-root-user form is used instead.
The startup probe validated only the mapping flags against the trivial
program `true`, but the real launcher always adds
--mount --ipc --pid --uts --fork. On environments where the user
namespace is created but mount propagation inside it is restricted
(e.g. AppArmor-restricted CI runners), the fallback mapping passed the
probe and the sandbox activated, yet every sandboxed command died with
"cannot change root filesystem propagation: Permission denied",
silently returning empty tool output and breaking the mock parity
suite.

The candidates now define the complete static launcher shape (mapping
flags + namespace flags), so probe success implies launch success; the
launcher reuses the candidate instead of re-appending the namespace
flags, keeping probe and launch as one source of truth. The
order-guarding test asserts the namespace flags are present in every
candidate.

Co-authored-by: linkst <2024023709@m.scnu.edu.cn>
…ap-auto-fallback

fix(sandbox): fall back to --map-auto when root-user mapping is restricted
@fork-sync-approver

Copy link
Copy Markdown
Author

👋 Sync ready for review @niStee — this PR syncs upstream changes into this fork.

To merge:

  1. Wait for CI checks to pass (if any)
  2. Click Approve
  3. Click Merge

Why manual approval? GitHub blocks any identity from approving its own PR (HTTP 422). The workflow can't auto-approve itself, so this is the standard Dependabot-style handoff pattern: workflow opens, you merge.

@niStee
niStee merged commit a5dd01b into main Aug 6, 2026
16 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.

3 participants