Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
ad71d9d
chore(hosting): point the dev tunnel at the ingress, and match tunnel…
jp-agenta Aug 12, 2026
a737af1
docs(dev-ingress): split the design into research, specs and tasks
jp-agenta Aug 12, 2026
a212a68
docs(agent): carry the gateways design set onto the base branch
jp-agenta Aug 12, 2026
2bacc2b
docs(agent): refresh the design set on the base branch with the wave …
jp-agenta Aug 12, 2026
0dd221c
chore(hosting): add a second dev tunnel for the ingress, keep the sto…
jp-agenta Aug 12, 2026
aceb35c
docs(agent): settle the four seed-blocking rulings and the outbound g…
jp-agenta Aug 12, 2026
96b6b89
chore(hosting): name the dev tunnels for what they publish
jp-agenta Aug 12, 2026
6f89b67
feat(gateways): seed the domain with declarations
jp-agenta Aug 13, 2026
3e765ef
feat(gateways): complete the exception mapping in the seed
jp-agenta Aug 13, 2026
b28c962
docs(agent): record R11, the exception-mapping gap found by writing t…
jp-agenta Aug 13, 2026
01da465
docs(dev-ingress): clarify what the tunnel agent API variable names
jp-agenta Aug 13, 2026
58531a5
chore(hosting): name dev tunnels for what they publish
jp-agenta Aug 13, 2026
da3a230
chore(hosting): follow the vendor-prefix env convention for the tunne…
jp-agenta Aug 13, 2026
3ffbcb8
chore(hosting): give ngrok its own section in the dev env examples
jp-agenta Aug 13, 2026
5b58c14
feat(gateways): add litellm as a direct API dependency, drop the enti…
jp-agenta Aug 13, 2026
76786e6
fix(runner): prefer the https listing when matching the store's tunnel
jp-agenta Aug 13, 2026
3014da4
core/access: add gateway endpoint permissions
jp-agenta Aug 13, 2026
a834f13
core/gateways: implement GatewayPolicyService
jp-agenta Aug 13, 2026
ba1ec49
test(gateways): unit tests for GatewayPolicyService
jp-agenta Aug 13, 2026
846ca18
docs(wp3): check off tasks-wp3.md and hand off the routers.py diff
jp-agenta Aug 13, 2026
799a376
gateways(policy): implement CredentialResolver
jp-agenta Aug 13, 2026
246f82c
gateways(policy): add CredentialResolver unit tests
jp-agenta Aug 13, 2026
effd78c
gateways(policy): check off tasks-wp2.md
jp-agenta Aug 13, 2026
1e76dfe
gateways(db): add LlmEndpointDBA, McpEndpointDBA and McpGrantDBA mixins
jp-agenta Aug 13, 2026
25e7acd
gateways(db): add LlmEndpointDBE, McpEndpointDBE and McpGrantDBE
jp-agenta Aug 13, 2026
688fcba
docs(agent): correct the run-token citation in related-work
jp-agenta Aug 13, 2026
46f6466
wp5: fake LLM adapter (in-process)
jp-agenta Aug 13, 2026
9064436
wp5: fake MCP adapter (in-process)
jp-agenta Aug 13, 2026
75fc779
gateways(db): add DBE<->DTO mappings for both planes, with unit tests
jp-agenta Aug 13, 2026
8380751
wp5: adapter interface contract tests
jp-agenta Aug 13, 2026
48065f2
gateways(db): implement LlmEndpointsDAO
jp-agenta Aug 13, 2026
15e31aa
gateways(db): implement McpEndpointsDAO and McpGrantsDAO
jp-agenta Aug 13, 2026
ab9ecab
wp5: deployable fake LLM server
jp-agenta Aug 13, 2026
406c0aa
wp5: deployable fake MCP server
jp-agenta Aug 13, 2026
6203705
gateways(db): migration for llm_gateway_endpoints, mcp_gateway_endpoi…
jp-agenta Aug 13, 2026
090e7e3
wp5: wire fakes into the local compose stack
jp-agenta Aug 13, 2026
9625b5c
wp5: acceptance verification script + routers.py diff recorded (not a…
jp-agenta Aug 13, 2026
5e6fbfd
fix(runner): treat an unparsable store endpoint as a hard failure
jp-agenta Aug 13, 2026
d6712d7
gateways(db): write integration tests for the three DAOs (not run)
jp-agenta Aug 13, 2026
d7c27f6
gateways(db): check off WP1's tasks-wp1.md checklist
jp-agenta Aug 13, 2026
a082bd6
wp5: stop naming the tunnel service, which dev-ingress renames
jp-agenta Aug 13, 2026
3f08727
docs(agent): tunnels belong to dev-ingress; the gateways add none
jp-agenta Aug 13, 2026
28c22ce
Merge branch 'chore/dev-ingress-tunnel' into feat/gateways
jp-agenta Aug 13, 2026
a542ae2
Merge branch 'feat/gateways-wp1' into feat/gateways
jp-agenta Aug 13, 2026
42e5264
Merge branch 'feat/gateways-wp2' into feat/gateways
jp-agenta Aug 13, 2026
8e0d89b
Merge branch 'feat/gateways-wp3' into feat/gateways
jp-agenta Aug 13, 2026
1dbf524
Merge branch 'feat/gateways-wp5' into feat/gateways
jp-agenta Aug 13, 2026
4ab973c
gateways: wire storage and the policy core into the composition root
jp-agenta Aug 13, 2026
b4b91ac
wp6: parse_llm_call_context
jp-agenta Aug 13, 2026
1237b43
gateways(mcp): McpUpstreamRegistry
jp-agenta Aug 13, 2026
94eab6b
wp6: PassthroughLlmAdapter
jp-agenta Aug 13, 2026
bd9c788
gateways(mcp): McpGatewayService CRUD delegation
jp-agenta Aug 13, 2026
6760fc5
wp6: passthrough adapter joins the south-port contract suite
jp-agenta Aug 13, 2026
559b100
gateways(llm): CRUD wire models
jp-agenta Aug 13, 2026
1386a2e
gateways(mcp): CRUD + grant wire models
jp-agenta Aug 13, 2026
8cc9c8e
gateways(mcp): list_endpoints three-namespace merge
jp-agenta Aug 13, 2026
6721317
gateways(mcp): declare grants surface for WP17/WP18
jp-agenta Aug 13, 2026
0b507d5
wp6: LlmGatewayProxy
jp-agenta Aug 13, 2026
313cf53
gateways(llm): LlmGatewayRouter CRUD
jp-agenta Aug 13, 2026
a264bdd
gateways(llm): LlmGatewayRouter tests
jp-agenta Aug 13, 2026
5ac56d6
gateways(mcp): McpGatewayRouter CRUD + grant reads
jp-agenta Aug 13, 2026
96b68ee
gateways(mcp): relay six-step orchestration
jp-agenta Aug 13, 2026
2f0df3a
gateways(mcp): McpGatewayRouter tests
jp-agenta Aug 13, 2026
e8b0c59
wp6: mount diff documented in tasks-wp6.md + acceptance tests (not run)
jp-agenta Aug 13, 2026
6167ee2
gateways(mcp): HttpMcpAdapter south-port implementation
jp-agenta Aug 13, 2026
de42411
gateways(mcp): check off WP9 tasks, record M2 entrypoint diff
jp-agenta Aug 13, 2026
b740d6c
gateways(mcp): HttpMcpAdapter unit tests
jp-agenta Aug 13, 2026
ddeb6fc
gateways(mcp): parse_mcp_call_context
jp-agenta Aug 13, 2026
508b023
gateways(mcp): McpGatewayProxy routes
jp-agenta Aug 13, 2026
2da42b5
gateways(mcp): McpGatewayProxy routing tests
jp-agenta Aug 13, 2026
8d41186
docs(gateways): check off WP8 tasks, hand off routers.py diff fragments
jp-agenta Aug 13, 2026
560f3d0
gateways(mcp): SSRF gate on custom endpoint registration
jp-agenta Aug 13, 2026
cd7403c
wp7: catalog.py — generated standard endpoints
jp-agenta Aug 13, 2026
06775f6
wp7: registry.py — LlmUpstreamRegistry + select_upstream
jp-agenta Aug 13, 2026
aa96453
wp7: TranslatedLlmAdapter
jp-agenta Aug 13, 2026
fe400ae
wp7: translated adapter joins the south-port contract suite
jp-agenta Aug 13, 2026
3b89c9b
wp7: LlmGatewayService management surface, list_models, relay_chat_co…
jp-agenta Aug 13, 2026
cb181ee
wp7: wire LlmGatewayService into the entrypoint (diff only)
jp-agenta Aug 13, 2026
3e2d6aa
docs(agent): record R12 and R13, and fix the mount placeholder names
jp-agenta Aug 13, 2026
a6761c7
wp7: acceptance verification
jp-agenta Aug 13, 2026
4049768
gateways(mcp): replace handle_gateway_exceptions with the proxy's own…
jp-agenta Aug 13, 2026
1fd54bd
gateways(mcp): assert status and stable cause for every mapped exception
jp-agenta Aug 13, 2026
177dbf9
docs(gateways): record the handle_gateway_exceptions correction in WP…
jp-agenta Aug 13, 2026
0f9f524
Merge branch 'feat/gateways-wp6' into feat/gateways
jp-agenta Aug 13, 2026
caf65a5
Merge branch 'feat/gateways-wp7' into feat/gateways
jp-agenta Aug 13, 2026
bf475f1
Merge branch 'feat/gateways-wp8' into feat/gateways
jp-agenta Aug 13, 2026
6ab0518
Merge branch 'feat/gateways-wp9' into feat/gateways
jp-agenta Aug 13, 2026
f951223
Merge branch 'feat/gateways-wp10' into feat/gateways
jp-agenta Aug 13, 2026
d757214
gateways: wire both planes into the composition root (M2)
jp-agenta Aug 13, 2026
6a704d1
gateways: keep the host allowlist an escape hatch, not configuration
jp-agenta Aug 13, 2026
c66f2ef
gateways: rename the fake upstreams to mocks, and fold their check in…
jp-agenta Aug 13, 2026
b84f55d
gateways: make the integration layer actually run
jp-agenta Aug 13, 2026
7e61f12
tests: integration Postgres falls back to published loopback
jp-agenta Aug 13, 2026
112e116
gateways: say secret, not credential
jp-agenta Aug 13, 2026
0bc5437
gateways: fix the review's findings
jp-agenta Aug 13, 2026
cd3dfd0
gateways: split builtin from standard; agenta is a builtin provider
jp-agenta Aug 13, 2026
cfc3570
gateways: bring entities.md up to what was built
jp-agenta Aug 13, 2026
0946aa7
gateways: drop grants, restructure the endpoint document, uppercase t…
jp-agenta Aug 14, 2026
4ba9320
auth: accept the gateways' X-AG-Credentials header, in preference to …
jp-agenta Aug 14, 2026
3ed634d
gateways(docs): D31-D33, drop grants to out-of-scope, strip history f…
jp-agenta Aug 14, 2026
581ea36
gateways(mcp): restore the URL on both generated builtin endpoints
jp-agenta Aug 14, 2026
9b7e0dc
gateways(docs): finish the D30 sweep; explain the endpoint tables' as…
jp-agenta Aug 14, 2026
b20b435
gateways(docs): plan wave 2, and record the wire gap it has to close
jp-agenta Aug 14, 2026
7ff1f83
gateways(docs): correct the endpoint-table asymmetry; open OD15 on pa…
jp-agenta Aug 14, 2026
d2922fb
gateways(docs): provider_key earns less than claimed; pass-through is…
jp-agenta Aug 14, 2026
88a3e5c
gateways(docs): OD16 on what translation is actually for; the data pl…
jp-agenta Aug 14, 2026
65d103c
gateways(docs): D34 -- the gateway never converts a body
jp-agenta Aug 14, 2026
56385d9
gateways: enforce the data-plane credentials rule, and schedule the r…
jp-agenta Aug 14, 2026
94267c6
gateways(docs): wave 2's prep -- the seed, four blocking rulings, and…
jp-agenta Aug 14, 2026
491e6d2
gateways(docs): wave 2 is prepped -- rulings settled, seven packages …
jp-agenta Aug 14, 2026
fe1f401
gateways(tests): the endpoint-edit test reads extras where it now lives
jp-agenta Aug 14, 2026
c0c59ca
gateways(tests): fixture hostnames point at the mocks, and the wave i…
jp-agenta Aug 14, 2026
e9694c1
gateways(tests): the MCP acceptance calls route by header, as a clien…
jp-agenta Aug 14, 2026
1217a85
gateways(docs): OD17 -- which MCP servers a stateless relay reaches, …
jp-agenta Aug 14, 2026
9654939
Merge remote-tracking branch 'origin/release/v0.112.1' into feat/gate…
jp-agenta Aug 14, 2026
643c76b
gateways(seed): wave 2 -- gateway credentials on the wire, loopback e…
jp-agenta Aug 14, 2026
5694eeb
gateways(docs): the wave-2 seed is 643c76bda2, and what it gives a pa…
jp-agenta Aug 14, 2026
9d75aa3
gateways(policy): emit one audit event per call
jp-agenta Aug 14, 2026
6164819
gateways(llm): responses and messages front doors
jp-agenta Aug 14, 2026
091b641
gateways(sdk): resolve connections to the gateway route
jp-agenta Aug 14, 2026
2f4bf53
gateways(sdk): the gateway base is the API base, no separate variable
jp-agenta Aug 14, 2026
da47149
gateways(sdk): the gateway decides routing, not the SDK
jp-agenta Aug 14, 2026
fd06c5c
M4: merge WP12 -- the resolver returns a gateway route
jp-agenta Aug 14, 2026
b436852
gateways(docs): close OD16 with the per-provider answers
jp-agenta Aug 14, 2026
50c51e6
gateways(agent): route model calls through the gateway
jp-agenta Aug 14, 2026
d981fd8
gateways(runner): wire a structured error detail for gateway refusals
jp-agenta Aug 14, 2026
8997738
gateways(llm): one relay, no conversion
jp-agenta Aug 14, 2026
5d89d17
gateways(runner): carry a gateway route instead of provider secrets
jp-agenta Aug 14, 2026
31902cb
gateways(db): renumber the gateway-endpoints migration off the releas…
jp-agenta Aug 14, 2026
c994dba
gateways(runner): carry the gateway route on Pi's direct-deployment p…
jp-agenta Aug 14, 2026
c640c7b
gateways(runner): point MCP servers at the gateway
jp-agenta Aug 14, 2026
e0b07f8
M5: merge wp4
jp-agenta Aug 14, 2026
2fa673d
M5: merge wp24 -- one relay, no conversion
jp-agenta Aug 14, 2026
92ecc39
M5: merge wp13
jp-agenta Aug 14, 2026
bda56a1
M5: merge wp15 -- MCP servers point at the gateway
jp-agenta Aug 14, 2026
846e8fa
M5: merge wp14 -- agent v0 on the gateway route
jp-agenta Aug 14, 2026
4e50f1f
gateways(docs): D35 -- a gateway target must be registered before an …
jp-agenta Aug 14, 2026
3468c65
gateways(docs): absolute numbering -- C for checkpoints, IM for inter…
jp-agenta Aug 14, 2026
3888e25
gateways(docs): reconcile IM numbering across plan and launch-2, and …
jp-agenta Aug 14, 2026
6f0613f
gateways(docs): fix two stale cleanup cross-references (CU9, the coun…
jp-agenta Aug 14, 2026
1beb363
gateways(docs): close OD2, OD13, OD15, OD16; rule OR15 out of scope; …
jp-agenta Aug 14, 2026
1a316aa
gateways(docs): wave 3 -- launch-3.md, WP25/WP26, CU13
jp-agenta Aug 14, 2026
89b3e7f
gateways(docs): our OAuth client authorizes custom endpoints -- that …
jp-agenta Aug 14, 2026
0fb0f2b
gateways(docs): D40 -- a named static field rewrite for resold Anthro…
jp-agenta Aug 14, 2026
8b9d8b9
gateways(docs): the unreachable-upstreams section is one exclusion no…
jp-agenta Aug 14, 2026
13467e6
gateways(docs): close OD10, overtaken by two shipped waves
jp-agenta Aug 14, 2026
2885864
gateways(docs): close WP27 phase 0 -- bedrock rejects a body carrying…
jp-agenta Aug 14, 2026
a7fbdfa
gateways(secrets): add oauth_provider and oauth_grant kinds
jp-agenta Aug 14, 2026
9389bfb
gateways(cu2): close module-level provider key cleanup, llm_v0 is rea…
jp-agenta Aug 14, 2026
8ad5e66
gateways(llm): static field rewrite for resold Anthropic wires (D40)
jp-agenta Aug 14, 2026
c180536
fix(hosting): turn off insecure-egress default wherever a deployment …
jp-agenta Aug 14, 2026
6c4e995
gateways(llm): compose the real InvokeModel/rawPredict URL (D40 pair)
jp-agenta Aug 14, 2026
8feed2d
gateways(docs): WP25 spec/tasks + close OD18 with the per-harness err…
jp-agenta Aug 14, 2026
ca32869
gateways(agent-service): surface errorDetail on the vercel stream
jp-agenta Aug 14, 2026
246cbf2
gateways(docs): record the base_url ambiguity on Bedrock/Vertex rows …
jp-agenta Aug 14, 2026
583b6b9
gateways(docs): open OD19 — what base_url means on a Bedrock/Vertex row
jp-agenta Aug 14, 2026
27f0e19
gateways(workflows): request_connection also asks for a gateway target
jp-agenta Aug 14, 2026
5b12d44
gateways(docs): specs and tasks for WP17 -- the MCP OAuth client
jp-agenta Aug 14, 2026
b3061ac
gateways(mcp): add the mcp SDK dependency
jp-agenta Aug 14, 2026
264db3c
gateways(mcp): oauth storage adapter over the secrets vault
jp-agenta Aug 14, 2026
8335b84
gateways(mcp): oauth state token
jp-agenta Aug 14, 2026
9ccae52
gateways(cu6): close the wire secret-array collapse, both legs alread…
jp-agenta Aug 14, 2026
76776b6
gateways(mcp): oauth discovery, registration and token exchange
jp-agenta Aug 14, 2026
b54da79
gateways(mcp): the oauth connect service
jp-agenta Aug 14, 2026
82e7ca9
chore(access): remove legacy credits-consumed counter and its access …
jp-agenta Aug 14, 2026
eefdfc6
gateways(cu12): collapse the SDK's two SSRF-guard copies, generate th…
jp-agenta Aug 14, 2026
f74810f
gateways(docs): OD21 -- oauth discovery guesses well-known paths inst…
jp-agenta Aug 14, 2026
545f38d
gateways(docs): CU14 -- the insecure-egress default disagrees across …
jp-agenta Aug 14, 2026
30db669
gateways(llm-proxy): render a machine-readable code marker on every t…
jp-agenta Aug 14, 2026
22ea869
gateways(runner): recover code from the marker when the gateway body …
jp-agenta Aug 14, 2026
bf861c4
gateways(agent-service): correct the rejected-credential test fixture…
jp-agenta Aug 14, 2026
0fda3de
gateways(proxy): share the code marker with the MCP plane, audit its …
jp-agenta Aug 14, 2026
23476e0
gateways(runner+docs): prove the marker recovers an MCP-plane refusal…
jp-agenta Aug 14, 2026
d50a3cf
gateways(docs): specs and tasks for WP20 client registration fallback
jp-agenta Aug 14, 2026
36a3fa3
gateways(mcp): the client registration detector and identity document
jp-agenta Aug 14, 2026
78fa417
gateways(mcp): serve the oauth client identity document
jp-agenta Aug 14, 2026
76904bb
gateways(mcp): swap client registration for the two-strategy version
jp-agenta Aug 14, 2026
3196bc3
gateways(docs): WP18 spec and tasks — consent flow
jp-agenta Aug 14, 2026
51189fe
gateways(mcp): wire the connect and callback routes
jp-agenta Aug 14, 2026
d4ff365
gateways(mcp): the consent-flow dashboard surface
jp-agenta Aug 14, 2026
6be4bb3
Merge branch 'feat/gateways-wp25' into feat/gateways-wp19
jp-agenta Aug 14, 2026
9a23c6e
Merge branch 'feat/gateways-wp26' into feat/gateways-wp19
jp-agenta Aug 14, 2026
f289ffd
gateways(wp19): step-up interaction — scope challenge raises a connec…
jp-agenta Aug 14, 2026
b3b0ddf
Merge branch 'feat/gateways-wp19' into feat/gateways
jp-agenta Aug 14, 2026
18f4d8f
Merge branch 'feat/gateways-wp20' into feat/gateways
jp-agenta Aug 14, 2026
089dc3c
Merge branch 'feat/gateways-wp27' into feat/gateways
jp-agenta Aug 14, 2026
cb09f8a
Merge branch 'feat/gateways-cu2' into feat/gateways
jp-agenta Aug 14, 2026
6afb244
Merge branch 'feat/gateways-cu6' into feat/gateways
jp-agenta Aug 14, 2026
568e2dc
Merge branch 'feat/gateways-cu10' into feat/gateways
jp-agenta Aug 14, 2026
0b5fab4
Merge branch 'feat/gateways-cu12' into feat/gateways
jp-agenta Aug 14, 2026
066adfc
Merge branch 'feat/gateways-cu13' into feat/gateways
jp-agenta Aug 14, 2026
40913ba
Merge branch 'feat/gateways-wp17' into feat/gateways
jp-agenta Aug 14, 2026
d0399e4
gateways: permissive insecure-egress default everywhere (CU14), and u…
jp-agenta Aug 14, 2026
a63b4c4
fix(api): OAuth discovery reads the 401's WWW-Authenticate before gue…
jp-agenta Aug 14, 2026
93677f8
Merge branch 'feat/gateways-od21' into feat/gateways
jp-agenta Aug 14, 2026
a5991ec
gateways(docs): OD19 -- base_url is a host override, and bedrock-mant…
jp-agenta Aug 14, 2026
928b5fd
gateways: close OD19 -- base_url is a host override on every kind, Be…
jp-agenta Aug 14, 2026
e732946
Merge branch 'feat/gateways-od19' into feat/gateways
jp-agenta Aug 14, 2026
2c5c5df
gateways(docs): record the latent Vertex base_url defect OD19 uncovered
jp-agenta Aug 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 0 additions & 30 deletions api/ee/src/core/access/entitlements/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class Counter(str, Enum):
EVALUATIONS_RUN = "evaluations_run"
TRACES_INGESTED = "traces_ingested"
TRACES_RETRIEVED = "traces_retrieved"
CREDITS_CONSUMED = "credits_consumed"
EVENTS_INGESTED = "events_ingested"
RECORDS_INGESTED = "records_ingested"

Expand Down Expand Up @@ -345,12 +344,6 @@ class Throttle(BaseModel):
period=Period.DAILY,
scope=Scope.USER,
),
Counter.CREDITS_CONSUMED: Quota(
free=100,
limit=100,
strict=True,
period=Period.MONTHLY,
),
Counter.EVENTS_INGESTED: Quota(
retention=Retention.WEEKLY,
period=Period.MONTHLY,
Expand Down Expand Up @@ -437,12 +430,6 @@ class Throttle(BaseModel):
scope=Scope.USER,
period=Period.DAILY,
),
Counter.CREDITS_CONSUMED: Quota(
free=100,
limit=100,
strict=True,
period=Period.MONTHLY,
),
Counter.EVENTS_INGESTED: Quota(
retention=Retention.MONTHLY,
period=Period.MONTHLY,
Expand Down Expand Up @@ -527,12 +514,6 @@ class Throttle(BaseModel):
scope=Scope.USER,
period=Period.DAILY,
),
Counter.CREDITS_CONSUMED: Quota(
free=100,
limit=100,
strict=True,
period=Period.MONTHLY,
),
Counter.EVENTS_INGESTED: Quota(
retention=Retention.QUARTERLY,
period=Period.MONTHLY,
Expand Down Expand Up @@ -615,12 +596,6 @@ class Throttle(BaseModel):
scope=Scope.USER,
period=Period.DAILY,
),
Counter.CREDITS_CONSUMED: Quota(
free=100,
limit=100,
strict=True,
period=Period.MONTHLY,
),
Counter.EVENTS_INGESTED: Quota(
period=Period.MONTHLY,
),
Expand Down Expand Up @@ -655,10 +630,6 @@ class Throttle(BaseModel):
scope=Scope.USER,
period=Period.DAILY,
),
Counter.CREDITS_CONSUMED: Quota(
strict=True,
period=Period.MONTHLY,
),
Counter.EVENTS_INGESTED: Quota(
period=Period.MONTHLY,
),
Expand Down Expand Up @@ -701,7 +672,6 @@ class Throttle(BaseModel):
Counter.EVALUATIONS_RUN,
Counter.TRACES_INGESTED,
Counter.TRACES_RETRIEVED,
Counter.CREDITS_CONSUMED,
Counter.EVENTS_INGESTED,
Counter.RECORDS_INGESTED,
],
Expand Down
2 changes: 1 addition & 1 deletion api/ee/src/core/meters/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Meters(str, Enum):
EVALUATIONS_RUN = Counter.EVALUATIONS_RUN.value
TRACES_INGESTED = Counter.TRACES_INGESTED.value
TRACES_RETRIEVED = Counter.TRACES_RETRIEVED.value
CREDITS_CONSUMED = Counter.CREDITS_CONSUMED.value
CREDITS_CONSUMED = "credits_consumed" # legacy, dropped from Counter; keeps old meter rows readable
EVENTS_INGESTED = Counter.EVENTS_INGESTED.value
RECORDS_INGESTED = Counter.RECORDS_INGESTED.value
# GAUGES
Expand Down
106 changes: 106 additions & 0 deletions api/entrypoints/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,34 @@
from oss.src.tasks.asyncio.triggers.dispatcher import TriggersDispatcher
from oss.src.tasks.taskiq.triggers.worker import TriggersWorker
from oss.src.tasks.taskiq.shared.broker import ProducerOnlyRedisStreamBroker

# GATEWAYS: core/gateways/ (entities.md §9 "Wiring"). Two router objects per plane —
# management CRUD and the data plane are separate surfaces (§1).
from oss.src.dbs.postgres.gateways.llms.dao import LLMEndpointsDAO
from oss.src.dbs.postgres.gateways.mcps.dao import MCPEndpointsDAO
from oss.src.core.gateways.policy.resolution import SecretsResolver
from oss.src.core.gateways.policy.service import GatewayPolicyService
from oss.src.core.gateways.llms.registry import LLMUpstreamRegistry
from oss.src.core.gateways.llms.service import LLMGatewayService
from oss.src.core.gateways.llms.providers.mock.adapter import MockLLMAdapter
from oss.src.core.gateways.llms.providers.passthrough.adapter import (
RelayLLMAdapter,
)
from oss.src.core.gateways.mcps.registry import MCPUpstreamRegistry
from oss.src.core.gateways.mcps.service import MCPGatewayService
from oss.src.core.gateways.mcps.providers.mock.adapter import MockMCPAdapter
from oss.src.core.gateways.mcps.providers.http.adapter import HttpMCPAdapter
from oss.src.core.gateways.mcps.oauth.client import MCPOAuthClient
from oss.src.core.gateways.mcps.oauth.service import MCPOAuthConnectService
from oss.src.apis.fastapi.gateways.llms.router import LLMGatewayRouter
from oss.src.apis.fastapi.gateways.llms.proxy import LLMGatewayProxy
from oss.src.apis.fastapi.gateways.mcps.router import MCPGatewayRouter
from oss.src.apis.fastapi.gateways.mcps.proxy import MCPGatewayProxy
from oss.src.apis.fastapi.gateways.mcps.oauth_router import MCPOAuthClientMetadataRouter

# ComposioMCPAdapter serves the builtin namespace and has no owner in wave 1: no brokered
# target is reachable yet, so our own servers and the mocks are the whole set (D23).

from oss.src.apis.fastapi.shared.utils import SupportHeadersMiddleware
from oss.src.dbs.postgres.mounts.dao import MountsDAO
from oss.src.core.mounts.service import MountsService
Expand Down Expand Up @@ -1063,6 +1091,58 @@ async def _dispatch_detached_run(*, project_id, user_id, request) -> str:
dispatch_task=_triggers_worker.dispatch_trigger,
)

# GATEWAYS: storage and the policy core (entities.md §9 "Wiring"). The plane services,
# their registries and the routers/proxies land with WP6-WP10.
llm_endpoints_dao = LLMEndpointsDAO(engine=_transactions_engine)
mcp_endpoints_dao = MCPEndpointsDAO(engine=_transactions_engine)

secrets_resolver = SecretsResolver(
vault_service=vault_service,
)

gateway_policy_service = GatewayPolicyService(resolver=secrets_resolver)

llm_gateway_service = LLMGatewayService(
llm_endpoints_dao=llm_endpoints_dao,
policy=gateway_policy_service,
resolver=secrets_resolver,
upstream_registry=LLMUpstreamRegistry(
adapters={
"relay": RelayLLMAdapter(),
"mock": MockLLMAdapter(),
}
),
)

mcp_gateway_service = MCPGatewayService(
mcp_endpoints_dao=mcp_endpoints_dao,
policy=gateway_policy_service,
resolver=secrets_resolver,
connections_service=connections_service,
upstream_registry=MCPUpstreamRegistry(
adapters={
"http": HttpMCPAdapter(),
"mock": MockMCPAdapter(),
}
),
)

mcp_oauth_connect_service = MCPOAuthConnectService(
vault_service=vault_service,
client=MCPOAuthClient(),
api_url=env.agenta.api_url,
secret_key=env.agenta.crypt_key,
)

llm_gateway_router = LLMGatewayRouter(llm_gateway_service=llm_gateway_service)
llm_gateway_proxy = LLMGatewayProxy(llm_gateway_service=llm_gateway_service)
mcp_gateway_router = MCPGatewayRouter(
mcp_gateway_service=mcp_gateway_service,
oauth_connect_service=mcp_oauth_connect_service,
)
mcp_gateway_proxy = MCPGatewayProxy(mcp_gateway_service=mcp_gateway_service)
mcp_oauth_client_metadata_router = MCPOAuthClientMetadataRouter()

simple_traces = SimpleTracesRouter(
simple_traces_service=simple_traces_service,
)
Expand Down Expand Up @@ -1499,6 +1579,32 @@ async def _dispatch_detached_run(*, project_id, user_id, request) -> str:
include_in_schema=False,
)

app.include_router(
router=llm_gateway_router.router,
prefix="/gateways/llms",
tags=["Gateway: LLM"],
)
app.include_router(
router=llm_gateway_proxy.router,
prefix="/gateways/llms",
include_in_schema=False,
)
app.include_router(
router=mcp_gateway_router.router,
prefix="/gateways/mcps",
tags=["Gateway: MCP"],
)
app.include_router(
router=mcp_gateway_proxy.router,
prefix="/gateways/mcps",
include_in_schema=False,
)
app.include_router(
router=mcp_oauth_client_metadata_router.router,
prefix="/gateways/mcps",
include_in_schema=False,
)

app.include_router(
router=sessions.interactions.router,
prefix="/sessions/interactions",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
"""add gateway endpoints

Creates the two tables the gateways domain persists (entities.md §1, §3):
llms_endpoints and mcps_endpoints. Every row in both is a custom row by
construction — standard and builtin endpoints are generated, never stored (D20).

The two new Postgres enum types (llmdeploymentkind_enum, gatewayauthscheme_enum)
use the enum member NAMES (upper-case), matching this codebase's existing
SQLAlchemy-enum convention (see secretkind_enum) rather than the lower-case
DTO values.

secret_id is SET NULL on both tables: a dead secret must not silently delete an
endpoint's configuration (§2.1). Each endpoint names one secret, project-owned —
user-level grants are out of scope, and reopening them adds tables rather than
changing these (out-of-scope.md).

Revision ID: oss000000022
Revises: oss000000020
Create Date: 2026-08-13 00:00:00.000000

"""

from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

revision: str = "oss000000022"
down_revision: Union[str, None] = "oss000000021"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
op.create_table(
"llms_endpoints",
sa.Column("id", sa.UUID(as_uuid=True), nullable=False),
sa.Column("project_id", sa.UUID(as_uuid=True), nullable=False),
sa.Column("slug", sa.String(), nullable=False),
sa.Column("name", sa.String(), nullable=True),
sa.Column("description", sa.String(), nullable=True),
sa.Column("provider_key", sa.String(), nullable=False),
sa.Column(
"deployment_kind",
sa.Enum(
"DIRECT",
"CUSTOM",
"AZURE",
"BEDROCK",
"SAGEMAKER",
"VERTEX",
name="llmdeploymentkind_enum",
),
nullable=False,
),
sa.Column("secret_id", sa.UUID(as_uuid=True), nullable=True),
sa.Column("data", postgresql.JSON(none_as_null=True), nullable=True),
sa.Column("status", postgresql.JSONB(none_as_null=True), nullable=True),
sa.Column("flags", postgresql.JSONB(none_as_null=True), nullable=True),
sa.Column("tags", postgresql.JSONB(none_as_null=True), nullable=True),
sa.Column("meta", postgresql.JSON(none_as_null=True), nullable=True),
sa.Column(
"created_at",
sa.TIMESTAMP(timezone=True),
server_default=sa.func.current_timestamp(),
nullable=True,
),
sa.Column("updated_at", sa.TIMESTAMP(timezone=True), nullable=True),
sa.Column("deleted_at", sa.TIMESTAMP(timezone=True), nullable=True),
sa.Column("created_by_id", sa.UUID(as_uuid=True), nullable=True),
sa.Column("updated_by_id", sa.UUID(as_uuid=True), nullable=True),
sa.Column("deleted_by_id", sa.UUID(as_uuid=True), nullable=True),
sa.PrimaryKeyConstraint("project_id", "id"),
sa.ForeignKeyConstraint(
["project_id"],
["projects.id"],
ondelete="CASCADE",
),
sa.ForeignKeyConstraint(
["secret_id"],
["secrets.id"],
ondelete="SET NULL",
),
sa.UniqueConstraint(
"project_id",
"slug",
name="uq_llms_endpoints_project_slug",
),
)
op.create_index(
"ix_llms_endpoints_project_provider",
"llms_endpoints",
["project_id", "provider_key"],
)
op.create_index(
"ix_llms_endpoints_flags",
"llms_endpoints",
["flags"],
postgresql_using="gin",
)

op.create_table(
"mcps_endpoints",
sa.Column("id", sa.UUID(as_uuid=True), nullable=False),
sa.Column("project_id", sa.UUID(as_uuid=True), nullable=False),
sa.Column("slug", sa.String(), nullable=False),
sa.Column("name", sa.String(), nullable=True),
sa.Column("description", sa.String(), nullable=True),
sa.Column(
"auth_mode",
sa.Enum(
"OAUTH",
"API_KEY",
"NONE",
name="gatewayauthscheme_enum",
),
nullable=False,
),
sa.Column("secret_id", sa.UUID(as_uuid=True), nullable=True),
sa.Column("data", postgresql.JSON(none_as_null=True), nullable=True),
sa.Column("status", postgresql.JSONB(none_as_null=True), nullable=True),
sa.Column("flags", postgresql.JSONB(none_as_null=True), nullable=True),
sa.Column("tags", postgresql.JSONB(none_as_null=True), nullable=True),
sa.Column("meta", postgresql.JSON(none_as_null=True), nullable=True),
sa.Column(
"created_at",
sa.TIMESTAMP(timezone=True),
server_default=sa.func.current_timestamp(),
nullable=True,
),
sa.Column("updated_at", sa.TIMESTAMP(timezone=True), nullable=True),
sa.Column("deleted_at", sa.TIMESTAMP(timezone=True), nullable=True),
sa.Column("created_by_id", sa.UUID(as_uuid=True), nullable=True),
sa.Column("updated_by_id", sa.UUID(as_uuid=True), nullable=True),
sa.Column("deleted_by_id", sa.UUID(as_uuid=True), nullable=True),
sa.PrimaryKeyConstraint("project_id", "id"),
sa.ForeignKeyConstraint(
["project_id"],
["projects.id"],
ondelete="CASCADE",
),
sa.ForeignKeyConstraint(
["secret_id"],
["secrets.id"],
ondelete="SET NULL",
),
sa.UniqueConstraint(
"project_id",
"slug",
name="uq_mcps_endpoints_project_slug",
),
)
op.create_index(
"ix_mcps_endpoints_flags",
"mcps_endpoints",
["flags"],
postgresql_using="gin",
)


def downgrade() -> None:

op.drop_index("ix_mcps_endpoints_flags", table_name="mcps_endpoints")
op.drop_table("mcps_endpoints")

op.drop_index("ix_llms_endpoints_flags", table_name="llms_endpoints")
op.drop_index(
"ix_llms_endpoints_project_provider",
table_name="llms_endpoints",
)
op.drop_table("llms_endpoints")

op.execute("DROP TYPE IF EXISTS gatewayauthscheme_enum")
op.execute("DROP TYPE IF EXISTS llmdeploymentkind_enum")
Loading
Loading