Skip to content

[Docs]: use-case repos never send caller_type, so copying them into a require_caller_identity tenant 401s #404

Description

@jy7lsna

Affected Component

Use-case repos: statewave-personal-assistant, statewave-multi-agent-memory, statewave-multi-agent-shared-context

What I found

None of the three SDK-based use-case repos ever sends caller_type, and only one sends caller_id:

Repo caller_id caller_type
statewave-multi-agent-shared-context yes (core/statewave_client.py:60) no
statewave-multi-agent-memory no (statewave_tools.py:98) no
statewave-personal-assistant no (app/services/statewave.py:112) no

A grep for caller_type across all four use-case repos returns nothing.

The SDK supports both:

>>> inspect.signature(statewave.StatewaveClient.get_context)
(self, subject_id, task, *, max_tokens=None, session_id=None, emit_receipt=None,
 query_id=None, task_id=None, parent_receipt_id=None, caller_id=None, caller_type=None)

And the server treats their absence as significant. server/api/context.py:36-45:

if tenant_config.get("require_caller_identity") and (
    not body.caller_id or not body.caller_type
):
    raise HTTPException(status_code=401, detail=...)

So a reader who copies any of these integration patterns — and statewave_tools.py and statewave_integration.py are explicitly written to be copied — into a tenant with require_caller_identity: true gets a hard 401 on every retrieval, from code that works fine against a default tenant. On a tenant in policy_mode: enforce the failure is quieter: server/services/policy.py matches rules on caller_type, so an absent one is the least-privileged caller and the bundle is thinned with no error at all.

Suggested resolution

Have the demos model the call the way a real deployment should make it — pass a caller_id and a stable caller_type per agent role (planner, reviewer, chat, …), which is also a nicer illustration of what policy rules match on than omitting them.

The mechanical part is small (one argument at each of the three call sites). The part I'd rather not decide alone is whether every demo should carry policy-grade identity, or whether one of them should show it and the rest stay minimal — happy to send the PR either way once someone picks.

Environment

All repos at main as of 2026-09-07; server read at 1.5.0.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions