Skip to content

Commit 014da62

Browse files
AtlantisPlebGemini 4 Carbon
andcommitted
fix(api,proto): update services/api test paths and inference pricing route schema (#14188)
Update services/api/ Python tests for the services/api/ layout move (3bc785d) and retired components/chat/ / apps/metaverse-web/ paths (#14260), replacing the deleted chat-lines-profile.coax shell-out in test_zchat.py with an inline Z/C/S/U/T cell and unescape round-trip check. Add sandbox_compute to InferenceInferencePricing in proto/openagents/api/v1alpha1/inference.proto and regenerate proto/descriptors/{api-routes,owned}.pb so routes-goldens.coax accepts GET /api/v1/inference/pricing 200 responses with metered sandbox tiers. Refs #14188 Co-Authored-By: Gemini 4 Carbon <[email protected]> Agent: antigravity
1 parent 0096508 commit 014da62

12 files changed

Lines changed: 90 additions & 19 deletions

File tree

‎proto/descriptors/api-routes.pb‎

679 Bytes
Binary file not shown.

‎proto/descriptors/owned.pb‎

679 Bytes
Binary file not shown.

‎proto/openagents/api/v1alpha1/inference.proto‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ message InferenceInferencePricing {
4545
optional string unit = 2 [json_name = "unit"];
4646
optional int64 local_cost_usd_micros = 3 [json_name = "local_cost_usd_micros"];
4747
repeated InferenceInferencePricingModel models = 4 [json_name = "models"];
48+
optional InferenceInferencePricingSandboxCompute sandbox_compute = 5 [json_name = "sandbox_compute"];
4849
}
4950

5051
message InferenceInferencePricingModel {
@@ -57,6 +58,20 @@ message InferenceInferencePricingModel {
5758
optional int64 markup_bps = 7 [json_name = "markup_bps"];
5859
}
5960

61+
message InferenceInferencePricingSandboxCompute {
62+
optional string unit = 1 [json_name = "unit"];
63+
optional int64 local_cost_usd_micros = 2 [json_name = "local_cost_usd_micros"];
64+
optional int64 min_reserve_seconds = 3 [json_name = "min_reserve_seconds"];
65+
repeated InferenceInferencePricingSandboxSize sizes = 4 [json_name = "sizes"];
66+
}
67+
68+
message InferenceInferencePricingSandboxSize {
69+
optional string name = 1 [json_name = "name"];
70+
optional int64 vcpu = 2 [json_name = "vcpu"];
71+
optional int64 memory_gb = 3 [json_name = "memory_gb"];
72+
optional int64 usd_micros_hr = 4 [json_name = "usd_micros_hr"];
73+
}
74+
6075
// GET /api/v1/inference/usage 200
6176
message InferenceInferenceUsage {
6277
optional string who = 1 [json_name = "who"];

‎proto/verse/api-routes-v1alpha1.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,7 @@
10241024
{"route": 474, "body": "{\"state\":\"code\",\"code\":\"9f2c4e1a7b3d5f60812a4c6e8b0d2f41\",\"expires_in\":300}"},
10251025
{"route": 475, "body": "{\"state\":\"logged-in\",\"account\":\"acct_q3w7e2r5t8y1u4i6o9p0a3s5d7\",\"new\":false,\"access_token\":\"oa_at_6b1d9e4f2a7c3e8b5d0f1a6c9e2b4d7f\",\"refresh_token\":\"oa_rt_3e8b1d6f9a2c5e0b7d4f1a8c3e6b9d2f\",\"expires_in\":3600,\"device_bound\":false,\"player\":null}"},
10261026
{"route": 476, "body": "{\"currency\":\"USD\",\"unit\":\"micros_per_million_tokens\",\"local_cost_usd_micros\":0,\"models\":[{\"name\":\"google/gemini-4-neon\",\"kind\":\"chat\",\"input_micros\":3750000,\"cached_input_micros\":187500,\"output_micros\":18750000,\"per_call_micros\":0,\"markup_bps\":2500},{\"name\":\"openagents/router-decision\",\"kind\":\"decision\",\"input_micros\":0,\"cached_input_micros\":0,\"output_micros\":0,\"per_call_micros\":250,\"markup_bps\":2500}]}"},
1027+
{"route": 476, "body": "{\"currency\":\"USD\",\"unit\":\"micros_per_million_tokens\",\"local_cost_usd_micros\":0,\"models\":[{\"name\":\"google/gemini-4-neon\",\"kind\":\"chat\",\"input_micros\":3750000,\"cached_input_micros\":187500,\"output_micros\":18750000,\"per_call_micros\":0,\"markup_bps\":2500}],\"sandbox_compute\":{\"unit\":\"usd_micros_per_hour\",\"local_cost_usd_micros\":0,\"min_reserve_seconds\":900,\"sizes\":[{\"name\":\"small\",\"vcpu\":2,\"memory_gb\":8,\"usd_micros_hr\":22500},{\"name\":\"default\",\"vcpu\":4,\"memory_gb\":16,\"usd_micros_hr\":45000},{\"name\":\"large\",\"vcpu\":8,\"memory_gb\":16,\"usd_micros_hr\":90000}]}}"},
10271028
{"route": 477, "body": "{\"who\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"credit_msat\":19750,\"local_usd_micros\":0,\"today\":{\"requests\":1,\"usd_micros\":250},\"total\":{\"calls\":1,\"in_tokens\":0,\"cached_in_tokens\":0,\"out_tokens\":0,\"usd_micros\":250,\"msat\":250},\"decisions\":{\"calls\":1,\"usd_micros\":250,\"msat\":250}}"},
10281029
{"route": 478, "body": "{\"error\":\"GET pricing\"}"}
10291030
]

‎services/api/test_health.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The Health card (pt-analytics-contract): per surface, the last event, the
22
# last hour and day, and the contract events not seen in a day. test.py runs
33
# this file after test_dashboard.py, with its helpers.
4-
contract_file = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "analytics-contract.json")))
4+
contract_file = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "coax", "web", "analytics-contract.json")))
55
check("the contract in the database is the one the release walk checks",
66
sorted(sql("select surface || '/' || ev from analytics.contract").split("\n")) == sorted(f"{p}/{e}" for p, evs in contract_file.items() for e in evs))
77
__import__("time").sleep(1.1)

‎services/api/test_jobs.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def capacity_record(day, t, seated, verdict="holds", env="staging"):
314314
check("jobs: the same day again is already ran, with the day's result", s == 200 and b.get("state") == "already ran" and b.get("result", {}).get("signatures", 0) >= 1, (s, b))
315315
if os.environ.get("OPS_CAPTURE"):
316316
json.dump(ops_seen, open(os.environ["OPS_CAPTURE"], "w"), indent=1)
317-
if os.path.exists(os.path.join(SV_REPO, "coax", "web", "api", "ops-wire-goldens.coax")):
317+
if os.path.exists(os.path.join(SV_REPO, "services", "api", "ops-wire-goldens.coax")):
318318
f = tempfile.NamedTemporaryFile(suffix=".json", delete=False, mode="w")
319319
json.dump(ops_seen, f)
320320
f.close()

‎services/api/test_npc.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def system_of(i=-1):
113113

114114
# The Haunted House (metaverse/web/realm.coax realm_npc_body): the character's id in the house, what
115115
# players taught them as the scene. Our table is metaverse/worlds/haunt/house.json's npcs: fail when the two differ.
116-
house = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..", "metaverse", "haunt", "house.json")))
116+
house = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "metaverse", "worlds", "haunt", "house.json")))
117117
for person in house["npcs"]:
118118
npc_reset()
119119
status, a, _ = ask({"npc": person["id"], "world": "haunted-house", "scene": "Players have taught you this, and it is true here: the key is under the rug.",
@@ -261,7 +261,7 @@ def ask_as(key, addr, visit, question, npc="marta"):
261261
# metaverse/engine/talk/wire.coax (metaverse/engine/talk/wire-goldens.coax checks the codec writes and reads each). Each is
262262
# posted as it is, byte for byte, by a new player, and gets the fixture's status; a 200's body is the answer
263263
# the fixture names, byte for byte.
264-
npc_fx = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..", "proto", "verse", "npc-ask-v1.json")))
264+
npc_fx = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "proto", "verse", "npc-ask-v1.json")))
265265
fx_owner, fx_owner_addr = npc_fresh()
266266
st, raw, _ = call("POST", "/api/playtest/realms", json.dumps({"board": {"name": "Fixture Hollow", "features": [
267267
{"feature": "rocks", "on": True, "count": 2}, {"feature": "character", "on": True, "name": "Old Mott", "role": "keeps the bridge"}]}}).encode(),

‎services/api/test_player.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def save(payload, version=2):
187187
# player.c's container_ok is held to the same bytes: every golden container is kept and comes back
188188
# byte for byte, and each malformed one gets what its "server" says: refused with a 400, or kept
189189
# (the server checks the magic, version, layer and CRC-32 only; the page's save_open refuses those).
190-
aesv_fx = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..", "proto", "verse", "realm-save-aesv-v1.json")))
190+
aesv_fx = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "proto", "verse", "realm-save-aesv-v1.json")))
191191
aesv_slot = "progress/haunted-house/aesv"
192192
aesv_rev = pt("GET", aesv_slot, key=guest["key"])[1]["rev"]
193193
for fx in aesv_fx["containers"] + aesv_fx["read_only"]:

‎services/api/test_realm_builder.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def put_card(body, key):
493493
# holds each request as the page and the CLI send it and each answer as the server gives it; the
494494
# plan's number is the run's, so it is 41 in the fixture and swapped both ways here.
495495
import re
496-
bfx = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..", "proto", "verse", "realm-board-v1.json")))
496+
bfx = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "proto", "verse", "realm-board-v1.json")))
497497
fx_key = b_player()
498498
fx_plan = 0
499499
for stp in bfx["steps"]:
@@ -512,7 +512,7 @@ def put_card(body, key):
512512
check("board fixture: " + stp["name"], st == stp["status"] and got == stp["reply"], (st, got))
513513
# the lists the planner's model writes (proto/verse/realm-lists-v1.json "model_steps"): an ask's and a
514514
# revision's answers and the feature list, on the realm the board fixture made; ids are 41 in the fixture
515-
lfx = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..", "proto", "verse", "realm-lists-v1.json")))
515+
lfx = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "proto", "verse", "realm-lists-v1.json")))
516516
for stp in lfx["model_steps"]:
517517
if "model" in stp:
518518
builder_mode["text"] = json.dumps(stp["model"])

‎services/api/test_realm_rights.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def w_signed(slug, body):
2121

2222
def realm_rights_checks():
2323
here = os.path.dirname(os.path.abspath(__file__))
24-
realms = json.load(open(os.path.join(here, "..", "..", "..", "apps", "metaverse-web", "realms.json")))
24+
realms = json.load(open(os.path.join(here, "..", "..", "metaverse", "web", "realms.json")))
2525
hand = {w["realm"]["slug"]: w["realm"]["edit"] for w in realms["worlds"] if "realm" in w and "edit" in w["realm"]}
2626
seeded = {}
2727
for line in sql("select slug || '|' || owner_account || '|' || array_to_string(admins, ',') || '|' || array_to_string(tools, ',') || '|' "

0 commit comments

Comments
 (0)