fix: bound Work model generation

This commit is contained in:
wuyang
2026-07-26 16:03:59 +08:00
parent be7abbd18f
commit af141845ed
3 changed files with 12 additions and 1 deletions
+2
View File
@@ -9,6 +9,7 @@ from agent_platform.config import Settings
TRANSIENT_COMPLETE_STATUS_CODES = frozenset({408, 425, 429, 500, 502, 503, 504, 524}) TRANSIENT_COMPLETE_STATUS_CODES = frozenset({408, 425, 429, 500, 502, 503, 504, 524})
COMPLETE_MAX_ATTEMPTS = 2 COMPLETE_MAX_ATTEMPTS = 2
COMPLETE_MAX_TOKENS = 4096
MAX_RETRY_DELAY_SECONDS = 5.0 MAX_RETRY_DELAY_SECONDS = 5.0
@@ -152,6 +153,7 @@ class ModelProvider:
"model": model, "model": model,
"messages": messages, "messages": messages,
"stream": True, "stream": True,
"max_tokens": COMPLETE_MAX_TOKENS,
} }
if tools: if tools:
payload["tools"] = tools payload["tools"] = tools
+7
View File
@@ -7,6 +7,8 @@
- Public host port: `12004` - Public host port: `12004`
- Execution provider: `ssh-docker` - Execution provider: `ssh-docker`
- Execution host Docker root: `/srv/k1412-data/docker` - Execution host Docker root: `/srv/k1412-data/docker`
- Runtime model API route: `http://172.31.0.1:3000` (NAS host gateway
from the `k1412-agent_egress` network, bypassing the public proxy)
- Execution host workspace volumes: Docker volumes named - Execution host workspace volumes: Docker volumes named
`k1412-ws-data-<hashed-user-id>` `k1412-ws-data-<hashed-user-id>`
@@ -32,6 +34,11 @@ Copy `deploy/docker-compose.yml`, `deploy/docker-compose.override.yml`, and
tags and non-secret settings in the protected `.env`, validate with tags and non-secret settings in the protected `.env`, validate with
`docker compose config`, pull, and recreate. `docker compose config`, pull, and recreate.
On the NAS deployment, set `MODEL_API_BASE_URL` to the internal model API route
listed above. `https://api.k1412.top` remains the external API entrypoint, but
Runtime must not send long-running Agent inference through the public reverse
proxy.
The SSH override removes `/var/run/docker.sock` from Gateway and mounts the The SSH override removes `/var/run/docker.sock` from Gateway and mounts the
dedicated SSH directory read-only at `/root/.ssh`. dedicated SSH directory read-only at `/root/.ssh`.
+3 -1
View File
@@ -136,7 +136,9 @@ async def test_complete_aggregates_streamed_tool_call(settings: Settings) -> Non
body = "".join(f"data: {json.dumps(chunk)}\n\n" for chunk in chunks) + "data: [DONE]\n\n" body = "".join(f"data: {json.dumps(chunk)}\n\n" for chunk in chunks) + "data: [DONE]\n\n"
def handler(request: httpx.Request) -> httpx.Response: def handler(request: httpx.Request) -> httpx.Response:
assert json.loads(request.content)["stream"] is True request_payload = json.loads(request.content)
assert request_payload["stream"] is True
assert request_payload["max_tokens"] == 4096
return httpx.Response( return httpx.Response(
200, 200,
request=request, request=request,