Add session permission updates
Some checks failed
Test / test (3.3) (push) Failing after 9m59s
Test / test (3.4) (push) Failing after 10m0s
Test / test (3.2) (push) Failing after 10m3s

This commit is contained in:
2026-07-10 19:29:31 -07:00
parent 889d38332f
commit 8dbd3de81c
5 changed files with 50 additions and 2 deletions

View File

@@ -53,6 +53,24 @@ class SmokeTest < Minitest::Test
assert_equal SESSION_ID, response[:id]
end
def test_update_session_patches_permissions_and_returns_the_updated_session
permissions = [
{ permission: "skill", pattern: "*", action: "deny" },
{ permission: "skill", pattern: "core-details", action: "allow" }
]
stub_request(:patch, "#{BASE}/session/#{SESSION_ID}")
.with(body: { permission: permissions }.to_json)
.to_return(status: 200, body: { id: SESSION_ID, permission: permissions }.to_json,
headers: { "Content-Type" => "application/json" })
response = @client.update_session(SESSION_ID, permissions: permissions)
assert_equal SESSION_ID, response[:id]
assert_equal permissions, response[:permission]
assert_requested :patch, "#{BASE}/session/#{SESSION_ID}", times: 1
end
def test_send_message_async_returns_empty_body
stub_request(:post, "#{BASE}/session/#{SESSION_ID}/prompt_async")
.to_return(status: 204, body: "")