Skip to content

test(desktop): restore the read-only parent in the child approval test - #6694

Closed
YongGoose wants to merge 1 commit into
apache:rust-previewfrom
YongGoose:test/desktop-child-approval-sandbox
Closed

YongGoose wants to merge 1 commit into
apache:rust-previewfrom
YongGoose:test/desktop-child-approval-sandbox

Conversation

@YongGoose

Copy link
Copy Markdown
Member

Summary

desktop_parent_reviews_child_access_and_opens_attributed_sender_beside has failed on every rust-preview push since #6684. The error is no single control labelled Approve child decision.

#6684 made a conversation a person creates take its access from the default sandbox, which is workspace write. The test's parent therefore already permitted the child's request to write workspace/report.md. Its SessionRespond was recorded without a person, and the confirmation the test waits for never appeared. The product behaves as #6684 intends, and #6684 updated the matching unit test the same way.

This makes the parent conversation read-only before it delegates. It uses the metadata permissions update a person makes when changing a conversation's sandbox, so the child again asks for access its parent lacks. The rest of the test is unchanged.

Fixes #6693

Verification

On macOS 27.0.1 (arm64) at 0a5ce771a:

  • Before: the test fails with the CI error after about 65 s, without this change.
  • After: the test passes in about 6.5 s.
  • cargo nextest run -p maka-cli --no-default-features --features desktop-tests --test integration -E 'test(terminal::desktop_new_session)', the CI desktop recipe: 21 passed.
  • node scripts/ci.mjs check format passes.

I ruled out a smaller change: moving the requested path outside the workspace doesn't help, because the fixture lives under the temporary directory, which workspace write already permits. Temporary logging (not committed) showed that both conversations were workspace_write and that the parent's tool result was recorded.

Not run: the full just check and the Windows suites.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code traced the CI failure to #6684, confirmed the cause with temporary logging, wrote the test change and ran the checks above. The commit carries Generated-by: Claude Code.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Since apache#6684 a conversation a person creates takes its access from the
default sandbox, which writes the workspace. The test's parent therefore
already permitted the write its child asked for, answered it without a
person, and Approve child decision never appeared.

Make the parent read-only before it delegates, through the same
permissions update a person makes, so the child again asks for access
its parent lacks.

Fixes apache#6693

Generated-by: Claude Code

@Astro-Han Astro-Han 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.

I reviewed the complete one-file change at b5bf9351133570452edc3771d4a0067b6c16f7a6 and the surrounding parent/child permission journey. It explicitly changes the newly created parent to read-only through the normal metadata operation, checks that operation committed, and then exercises the existing child approval flow. This restores the test's missing premise after new conversations began using the default sandbox. I found no confirmed P0–P2 issue in this test-only change.

I checked the hosted execution rather than relying only on the reported local result. In CI 42383527416, job 128438361065 checks out 50402d5, merging this head into 0a5ce771a, and the complete parent/child journey passes in 20.666 seconds; all six tests in that job pass. Earlier baseline runs fail while waiting for Approve child decision. This is evidence for the corrected fixture; it does not establish that every previous desktop failure had the same cause.

The full CI run still fails: the default-sandbox settings journey reads workspace-write where it expects danger-full-access, and the new-draft completion journey cannot find Close settings. I read both failing logs and have not established their cause. This PR changes only the parent fixture in a different test. I did not run the native desktop or Windows suites locally, and I have not approved or merged this PR.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@M4n5ter

M4n5ter commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Thanks for tracking down the root cause after #6684 and putting together this fix, @YongGoose!

Since this PR was opened, the underlying fixture disconnect has already been resolved at the root cause on rust-preview:

  1. Fixture sandbox propagation (feat(nsh): replace GPUI with native desktop and terminal backends #6674 / 57470e4c1): Fixture::open_with_configuration and configure() in products/maka/terminal-shell/tests/real_host/support.rs now propagate configuration["agent"]["permissions"]["access"] (which defaults to "read_only" unless overridden by a test) directly into ConfigurationStore::set_chat_defaults(ChatDefaults { sandbox_mode }).
  2. Explicit precondition assertion (fix(desktop): retain the Rust preview client after window close #6695 / 9864d52160): desktop_parent_reviews_child_access_and_opens_attributed_sender_beside in products/maka/terminal-shell/tests/real_host/desktop_new_session.rs now explicitly asserts observed["session"]["permissions"]["access"] == "read_only" before delegating (which is also why this PR currently has a merge conflict).
  3. CI verification: terminal::desktop_new_session::desktop_parent_reviews_child_access_and_opens_attributed_sender_beside is passing cleanly on rust-preview across native-macos and native-windows (22/22).

Closing this PR (and #6693) as superseded/resolved on rust-preview. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants