Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

sdk: caller-side label requirements are all-of in the SDKs, any-of in sam-node

Open
#508 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go, javascript, python

Research direction

Start with sdk/README.md:40, api/datalog.go:641, sdk/python/src/agent_mesh/mcp_client.py:58, and sdk/js/src/mcp.ts:117. Run internal/node/labels_gate_test.go:77 and compare the same inputs against both SDK predicates. Confirm which semantics is authoritative, then make the affected checks and tests agree for empty, full, partial, and total matches.

Written by the indexing model from the issue text.

Description

Summary

The parity matrix in sdk/README.md:40 lists "Caller-side label requirements on the provider's credential" as yes for both SDKs. The semantics differ: sam-node treats the caller's required labels as any-of, both SDKs treat them as all-of.

The divergence

semantics code
sam-node any-of api/datalog.go:641 — strings.Join(clauses, " or "), via checkPeerLabels
Python SDK all-of sdk/python/src/agent_mesh/mcp_client.py:58
JS SDK all-of sdk/js/src/mcp.ts:117

Proof

Running the inputs from the Go test's own any-of requirement matches one key case (internal/node/labels_gate_test.go:77, expectErr: false) through the SDK predicate:

provider: {region: na-us, team: platform}
required: {region: eu,    team: platform}

sam-node -> allowed              (labels_gate_test.go:77 - observed PASS)
SDK      -> LabelsNotSatisfiedError: missing region=eu

The two agree everywhere else. An empty requirement, a full match and a total mismatch all behave identically; the only divergence is more than one required pair with a partial match.

Impact

The SDKs are the stricter side, so this fails closed — all-of is a subset of any-of, and no SDK call is admitted that sam-node would refuse. The effect is availability: an agent that passes more than one required label is refused a provider the mesh would have allowed, and the same call succeeds through the sidecar.

Which side is authoritative

I read Go as the contract — the behaviour is pinned by a test case named for it, and mcp_client.py:49 documents itself as checkPeerLabels. But that is the question worth settling before either side moves: if all-of was the intent, then the Go check, its test and the header contract are what should change.

Offer

Happy to send the patch in whichever direction you pick — SDKs to any-of, or Go to all-of. Two files plus tests either way.

Dominant language
Go
Stars
926
Forks
138
Avg merge
10h 37m
Merged PRs (30d)
125

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/sam

All issues in google/sam

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.