WeKnora/migrations/sqlite/000041_agent_collaborations...

14 lines
672 B
MySQL
Raw Normal View History

feat(assistant): add durable multi-agent collaboration and live task views (#4438) * feat(assistant): add persistent multi-agent collaboration and live task views * fix(ci): wrap runtime notice message append * fix(agent): preserve collaboration results and prevent duplicate execution * fix(agent): fence panic followups and preserve approval timelines * test(frontend): stub connector labels in assistant refresh fixture * fix(migrations): avoid collaboration migration collision with main * fix(assistant): preserve child continuations and artifact access * fix(frontend): align artifact and icon checks with updated UI * fix: enforce child approvals and finalize interrupted collaboration runs * feat: support inherited temporary agent workers * docs: clarify inherited worker scope and lifecycle * fix: harden assistant retrieval and final delivery * fix(agent): keep closed child prompts continuable and renew active deadlines Expired child approvals were looked up by the child session, so the parent group stayed open and the run became needs_attention. Active collaborations also expired one hour after creation. * fix(lint): clear golangci-lint findings on the collaboration PR The previous CI run failed on line length, gofumpt, unchecked closes, and an unused dial parameter. * fix(ci): use the public npm registry for frontend dependencies * fix(agent): address collaboration review findings - keep ordinary fallbacks when a turn delegated no work - throttle lease/deadline heartbeats and drop duplicated child answers - force-close or compact aggregates that exceed the size limit - clamp completion budget to the model output limit - honor prompt_suspend for non-collaboration tools - clean up collaborations and child sessions on session delete, prune old rows - bound concurrent child executions globally - retry prompt classification and tolerate transient heartbeat errors - scope prompt history to listed messages, reject nil tenants
2026-10-19 04:14:15 +00:00
CREATE TABLE IF NOT EXISTS agent_collaborations (
id VARCHAR(36) PRIMARY KEY,
tenant_id BIGINT NOT NULL,
user_id VARCHAR(64) NOT NULL,
session_id VARCHAR(36) NOT NULL,
status VARCHAR(32) NOT NULL,
version BIGINT NOT NULL,
data TEXT NOT NULL,
updated_at DATETIME NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_agent_collaborations_status ON agent_collaborations(status, updated_at);
CREATE INDEX IF NOT EXISTS idx_agent_collaborations_owner ON agent_collaborations(tenant_id, user_id, session_id);
CREATE UNIQUE INDEX IF NOT EXISTS idx_agent_collaborations_active_parent ON agent_collaborations(tenant_id, user_id, session_id) WHERE status IN ('active', 'cancelling');