feat(routing): add dynamic agent profile routing (#2698)
This commit is contained in:
@@ -132,6 +132,12 @@ func (r *Repository) runMigrations() error {
|
||||
return err
|
||||
}
|
||||
r.migrate.Apply("task_sessions.execution_profile_id", `ALTER TABLE task_sessions ADD COLUMN execution_profile_id TEXT NOT NULL DEFAULT ''`)
|
||||
r.migrate.Apply("task_sessions.route_generation", `ALTER TABLE task_sessions ADD COLUMN route_generation INTEGER NOT NULL DEFAULT 0`)
|
||||
r.migrate.Apply("task_sessions.route_state", `ALTER TABLE task_sessions ADD COLUMN route_state TEXT NOT NULL DEFAULT ''`)
|
||||
r.migrate.Apply("task_sessions.route_reason", `ALTER TABLE task_sessions ADD COLUMN route_reason TEXT NOT NULL DEFAULT ''`)
|
||||
r.migrate.Apply("task_sessions.downstream_acp_session_id", `ALTER TABLE task_sessions ADD COLUMN downstream_acp_session_id TEXT NOT NULL DEFAULT ''`)
|
||||
r.migrate.Apply("dynamic_route_states.continuation_json", `ALTER TABLE dynamic_route_states ADD COLUMN continuation_json TEXT NOT NULL DEFAULT ''`)
|
||||
r.migrate.Apply("dynamic_route_states.policy_state_json", `ALTER TABLE dynamic_route_states ADD COLUMN policy_state_json TEXT NOT NULL DEFAULT ''`)
|
||||
r.migrate.Apply("executors_running.execution_profile_id", `ALTER TABLE executors_running ADD COLUMN execution_profile_id TEXT NOT NULL DEFAULT ''`)
|
||||
r.migrate.Apply("executors_running.last_message_uuid", `ALTER TABLE executors_running ADD COLUMN last_message_uuid TEXT DEFAULT ''`)
|
||||
r.migrate.Apply("executors_running.metadata", `ALTER TABLE executors_running ADD COLUMN metadata TEXT DEFAULT '{}'`)
|
||||
@@ -338,6 +344,8 @@ func (r *Repository) runMigrations() error {
|
||||
// frontend snapshots the prior value before the advance to position the
|
||||
// "New" divider (see models.TaskSession.LastReadMessageID).
|
||||
r.migrate.Apply("task_sessions.last_read_message_id", `ALTER TABLE task_sessions ADD COLUMN last_read_message_id TEXT DEFAULT ''`)
|
||||
r.migrate.Apply("task_session_turns.execution_profile_id", `ALTER TABLE task_session_turns ADD COLUMN execution_profile_id TEXT NOT NULL DEFAULT ''`)
|
||||
r.migrate.Apply("task_session_turns.route_generation", `ALTER TABLE task_session_turns ADD COLUMN route_generation BIGINT NOT NULL DEFAULT 0`)
|
||||
|
||||
// Bounded task-level status projection. Keep this on the replay path as well
|
||||
// as the fresh schema path so an existing installation gets the table
|
||||
@@ -909,6 +917,10 @@ func (r *Repository) migrateSessionsRemoveAgentExecutionID() error {
|
||||
task_id TEXT NOT NULL,
|
||||
agent_profile_id TEXT,
|
||||
execution_profile_id TEXT NOT NULL DEFAULT '',
|
||||
route_generation INTEGER NOT NULL DEFAULT 0,
|
||||
route_state TEXT NOT NULL DEFAULT '',
|
||||
route_reason TEXT NOT NULL DEFAULT '',
|
||||
downstream_acp_session_id TEXT NOT NULL DEFAULT '',
|
||||
executor_id TEXT DEFAULT '',
|
||||
executor_profile_id TEXT DEFAULT '',
|
||||
environment_id TEXT DEFAULT '',
|
||||
@@ -937,6 +949,7 @@ func (r *Repository) migrateSessionsRemoveAgentExecutionID() error {
|
||||
)`,
|
||||
`INSERT INTO task_sessions_new SELECT
|
||||
id, task_id, agent_profile_id, execution_profile_id,
|
||||
route_generation, route_state, route_reason, downstream_acp_session_id,
|
||||
executor_id, executor_profile_id, environment_id, repository_id, base_branch,
|
||||
agent_profile_snapshot, executor_snapshot, environment_snapshot, repository_snapshot,
|
||||
state, error_message, metadata, started_at, completed_at, updated_at,
|
||||
@@ -1142,6 +1155,10 @@ func (r *Repository) migrateSessionsRemoveWorkflowStepID() error {
|
||||
container_id TEXT NOT NULL DEFAULT '',
|
||||
agent_profile_id TEXT,
|
||||
execution_profile_id TEXT NOT NULL DEFAULT '',
|
||||
route_generation INTEGER NOT NULL DEFAULT 0,
|
||||
route_state TEXT NOT NULL DEFAULT '',
|
||||
route_reason TEXT NOT NULL DEFAULT '',
|
||||
downstream_acp_session_id TEXT NOT NULL DEFAULT '',
|
||||
executor_id TEXT DEFAULT '',
|
||||
executor_profile_id TEXT DEFAULT '',
|
||||
environment_id TEXT DEFAULT '',
|
||||
@@ -1166,6 +1183,7 @@ func (r *Repository) migrateSessionsRemoveWorkflowStepID() error {
|
||||
)`,
|
||||
`INSERT INTO task_sessions_new SELECT
|
||||
id, task_id, agent_execution_id, container_id, agent_profile_id, execution_profile_id,
|
||||
route_generation, route_state, route_reason, downstream_acp_session_id,
|
||||
executor_id, executor_profile_id, environment_id, repository_id, base_branch,
|
||||
agent_profile_snapshot, executor_snapshot, environment_snapshot, repository_snapshot,
|
||||
state, error_message, metadata, started_at, completed_at, updated_at,
|
||||
|
||||
Reference in New Issue
Block a user