Repository navigation
Description
Describe the bug
On AgentScope Service 2.1.0-BETA1 (Docker Compose release), the very first Turn submitted to a freshly created Managed Agent fails immediately, before the model is ever invoked.
Root cause: table dp.agentscope_store defines item_key as character varying(255). The composite keys that HarnessAgent generates for session/agent-instance tracking (combining namespace + agent id + session id, e.g. dpa-namespace:<tenant>:<namespace>-<agentId>-sess_<id>-style strings) regularly exceed 255 characters. The insert is rejected by Postgres with value too long for type character varying(255), which bubbles up as IllegalStateException: JdbcStore putIfVersion (insert) failed, and the Turn is marked failed.
This reproduced consistently for two independently created agents/sessions in the same deployment, so it looks systemic rather than a one-off data issue — it blocks the documented quickstart / "create your first Managed Agent" tutorial from working out of the box on a clean deployment.
This may be related to the agentscope_store sizing issues in #1765 and #3217 (same table, different symptom: here it's an insert-time data-length rejection on Postgres rather than a MySQL index-size/collation problem).
To Reproduce
- Follow the Service quickstart (Docker Compose) to deploy
2.1.0-BETA1:init-env.sh, setDASHSCOPE_API_KEYandBUILDER_ALLOW_LOCAL_ENVIRONMENT=true, thendocker compose up -d --wait. - Create a Local Environment:
POST /api/environments{"name":"test","type":"local","config":{}}. - Create a Managed Agent:
POST /api/v1/agentswithbinding.kind=managed,definition.defaultEnvironmentIdset to the environment above, andagent_toolsettoolsread/writeenabled. - Create a Session targeting that agent:
POST /api/v1/agent-sessions{"target":{"type":"agent","id":"<AGENT_ID>"}}. - Submit any message as a Turn:
POST /api/v1/agent-sessions/{id}/turns. - Poll
GET /api/v1/agent-sessions/{id}/turns/{turnId}— status becomesfailedwithin ~1 second, before any model call happens.
Expected behavior
A freshly created Managed Agent's first Turn should execute normally (model call + tool calls) as documented, without any manual schema modification.
Error messages
as-dataplane log:
i.a.h.a.middleware.AgentTraceMiddleware : [<agent-name>] ERROR | IllegalStateException: JdbcStore putIfVersion (insert) failed
i.a.b.web.managed.SessionTurnRunner : Managed session turn failed: sessionId=sess_xxx, error=JdbcStore putIfVersion (insert) failed
Underlying Postgres error (docker compose logs db):
ERROR: value too long for type character varying(255)
followed on the next attempt by:
ERROR: duplicate key value violates unique constraint "agentscope_store_pkey"
Environment
- AgentScope Service Version:
2.1.0-BETA1(imagesas-controlplane,as-gateway,as-dataplane,as-scheduler, all2.1.0-BETA1) - Deployment: official Docker Compose release tarball (
agentscope-service-2.1.0-BETA1-compose.tar.gz), Compose v2 - Database: bundled PostgreSQL 17
- Java (in
as-dataplane): 21.0.12.1 (per startup logStarting DataApp v2.1.0-BETA1 using Java 21.0.12.1) - OS: macOS (Darwin), Docker Desktop
Additional context
Local workaround that unblocks the Turn (verified end-to-end — model call plus write_file/read_file tool calls both succeed afterwards):
ALTER TABLE dp.agentscope_store ALTER COLUMN item_key TYPE varchar(512);This is obviously not a supported fix (manual DDL outside the release's migration path), just confirmation that widening the column resolves it. A proper fix would either widen item_key in the shipped schema, or shorten/hash the generated key so it reliably fits within 255 characters.
Activity
answerallen commentedon Oct 11, 2026
Independent confirmation on
2.1.0-BETA1(official compose bundle, PostgreSQL 17) — same root cause, plus two data points that may help #3464.The key that overflows the column (277 characters):
Full error chain on our side
data-plane debug log:
PostgreSQL server log (
ALTER SYSTEM SET log_statement='mod'to capture the statement):Workaround verified end-to-end — after this, the same Managed agent runs the turn and answers (reached the model call,
POST_CALL | response: ...):Two notes for the fix
MysqlDialect.java:74declares the sameVARCHAR(255)(PGPostgresDialect.java:61, H2H2Dialect.java:47);SqliteDialect.java:48usesTEXT, so SQLite is unaffected. fix(jdbc): widen agentscope_store.item_key on PostgreSQL and H2 #3464 covers PostgreSQL + H2 — MySQL looks like it needs the same treatment..../session.json,.../head.json) insert fine and only the.../inbox/commits/<sha256>.jsonkey overflows, the table ends up looking "half written" and the failure is easy to misattribute. AnALTERon startup (or a validation error that names the offending column) would save every existing deployment from a manual patch.Thanks for #3464 — happy to re-test on this deployment once it lands.
fix(jdbc): widen agentscope_store.item_key on PostgreSQL and H2 (agen…