The line `_, current_tenant_id = current_account_with_tenant()` was
accidentally dropped during the merge-conflict resolution in commit
08e3c71f. Without it, `current_tenant_id` is undefined when
`get_app_permission_keys(...)` is called, raising a NameError that
surfaces as a 500 response and causes the e2e scenario
"Switch a Completion app to Workflow Orchestrate" to fail.