Commit Graph
7486 Commits
Author SHA1 Message Date
Charles Yao 55752cd435 feat(workflow-copilot): 17-kind card vocabulary + submit payload types 2026-08-22 00:00:46 -07:00
Charles Yao 5a098f89d4 fix(workflow-copilot): _run_status reports COMPLETE for Build/Edit terminal states 2026-08-21 23:49:45 -07:00
Charles Yao eb1ee3981a feat(workflow-copilot): Action/CheckpointRef + SessionView entry_mode/phase/actions/checkpoint 2026-08-21 23:36:53 -07:00
Charles Yao 6bceb1be62 feat(workflow-copilot): contract enums + Build/Edit PcState sets 2026-08-21 23:24:13 -07:00
Charles YaoandClaude Opus 4.8 2e8ab05acb fix(workflow-copilot): re-parent copilot migration onto main head
The add_workflow_copilot_tables migration (b28a1b2fbf4d) kept down_revision=e4708db55c1d after the branch was rebased onto main, forking the Alembic graph into two heads and letting a fresh DB skip the main lineage (e.g. workflows.version_number), which 500s the editor /workflows/draft. Re-point down_revision to the main head (56124e050600) so the chain is linear.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-19 01:48:31 -07:00
Charles YaoandClaude Opus 4.8 72c171b63c feat(copilot): record the failed Dify run as a CopilotRun on session create
create_fix_session now treats failed_run_id as the Dify workflow-run id and
records it as an immutable original-failed CopilotRun, pointing
fc.failed_run_id at that row so the async diagnose can resolve it. Closes the
FE->diagnose gap for a live Fix flow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:46:53 -07:00
Charles YaoandClaude Opus 4.8 086186a579 fix(copilot): close SSE subscription even if snapshot frame is interrupted
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:46:53 -07:00
Charles YaoandClaude Opus 4.8 b8b381afc0 feat(copilot): register console workflow-copilot routes
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:46:52 -07:00
Charles Yao 925491fac4 feat(copilot): SSE stream route (snapshot-first + heartbeat) 2026-08-18 21:45:07 -07:00
Charles Yao e82bef9ec3 test(copilot): compose real console decorator stack in routes test 2026-08-18 21:45:07 -07:00
Charles Yao 388edeef80 feat(copilot): console JSON routes (create/view/actions/messages) 2026-08-18 21:45:07 -07:00
Charles Yao 6431d146dc feat(copilot): service wiring + view-serialize + error-map helpers 2026-08-18 21:45:07 -07:00
Charles Yao 9d982be3d0 feat(copilot): pluggable CopilotAgent factory (P3c seam) 2026-08-18 21:45:07 -07:00
Charles Yao 0cfea5cea4 feat(copilot): workflow_copilot_enabled feature flag 2026-08-18 21:45:07 -07:00
Charles Yao 38cf016ee3 fix(copilot): construct advance deps inside try so the lock always releases 2026-08-18 21:45:07 -07:00
Charles Yao 837ee6e593 test(copilot): async usecase→task→SQL acceptance 2026-08-18 21:45:06 -07:00
Charles Yao 3099be4c69 feat(copilot): interrupted-session reconciler (beat) 2026-08-18 21:45:06 -07:00
Charles YaoandClaude Opus 4.8 1b975eb72e feat(copilot): async advance_session Celery task
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:06 -07:00
Charles Yao f4ff26b2a7 test(copilot): cover dispatch lock-release-on-enqueue-failure + submit_message payload 2026-08-18 21:45:06 -07:00
Charles Yao 48419e3f69 feat(copilot): copilot session usecase + dispatch 2026-08-18 21:45:06 -07:00
Charles YaoandClaude Opus 4.8 a7db7d36f1 feat(copilot): session progress bus over the broadcast channel
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:06 -07:00
Charles Yao 043df4e6dc fix(copilot): prefix-serialize lock-release eval key + prefix regression test 2026-08-18 21:45:06 -07:00
Charles Yao 639235de98 feat(copilot): cross-process session advance lock 2026-08-18 21:45:06 -07:00
Charles Yao eddb498df2 test(copilot): P1 engine runs on the SQL repository (SQLite) 2026-08-18 21:45:06 -07:00
Charles YaoandClaude Opus 4.8 f889a97032 feat(copilot): SQL repository — checkpoints, runs, test-inputs, conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:06 -07:00
Charles Yao 2ca01cc802 feat(copilot): SQL repository — sessions + version-CAS
Add SqlCopilotRepository implementing the Repository Protocol's session
lifecycle (create_session/get_session) and compare_and_advance as a real
DB-level version-CAS: a single UPDATE ... WHERE version=base_version, with
rowcount==0 disambiguated into NotFoundError (missing session) vs
ConflictError (stale version). A UNIQUE(session_id, seq) collision on
conversation items during compare_and_advance is caught and mapped to
ConflictError, making the DB the seq authority. Remaining Repository
methods (checkpoints/runs/test-inputs/list_conversation) are stubbed with
NotImplementedError, deferred to Task 5.

Tested against SQLite in-memory: create/get round-trip, CAS version bump,
stale-version conflict leaving the row unchanged, missing-session
NotFoundError, and duplicate-seq ConflictError.
2026-08-18 21:45:06 -07:00
Charles Yao 0c4eefba1b feat(copilot): FixContext JSON (de)serialization 2026-08-18 21:45:06 -07:00
Charles YaoandClaude Opus 4.8 c400f82527 feat(copilot): alembic migration for copilot session tables
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:05 -07:00
Charles Yao f8f11ff38d feat(copilot): SQLAlchemy models for copilot session persistence 2026-08-18 21:45:05 -07:00
Charles YaoandClaude Opus 4.8 3ec6c8990d fix(copilot): adapter review fixes — node_outputs test, tighter apply assert, publish audit fields, no-op apply short-circuit
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:05 -07:00
Charles Yao ef2ed808fd feat(copilot): WorkflowService-backed DifyPort adapter
Implements WorkflowServiceDifyPort, the real DifyPort adapter that wires
the pure P1 domain and Task 1-3 helpers to WorkflowService,
AppGenerateService, and the node-execution repository. Each method opens
its own session, resolves account/app via the identity helpers, and
mutates the draft graph client-side (no server-side patch primitive)
before writing it back with graph_only=True/sync_agent_bindings=False.
Pins the publish workflow_id+commit gotcha and the hash-mismatch
re-mapping. Confirmed via mocked-service unit tests and a runtime_checkable
isinstance(..., DifyPort) check.
2026-08-18 21:45:05 -07:00
Charles Yao 5a93bec706 feat(copilot): actor→account resolution + app loading with tenant guard 2026-08-18 21:45:05 -07:00
Charles YaoandClaude Opus 4.8 388d3a949b feat(copilot): pure run-result mapping
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:05 -07:00
Charles Yao 535788f1c1 feat(copilot): pure set_node_config graph mutation 2026-08-18 21:45:05 -07:00
Charles YaoandClaude Opus 4.8 4e73fb566b test(copilot): full fix-flow engine acceptance on fakes
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:05 -07:00
Charles Yao 6d4e9dd59b feat(copilot): port canned placeholder agent 2026-08-18 21:45:05 -07:00
Charles YaoandClaude Opus 4.8 0bd9b1f94a feat(copilot): port checklist handlers + merged fix registry
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:05 -07:00
Charles Yao b0177e9044 docs(copilot): document save_run id-preservation contract (T6 review) 2026-08-18 21:45:05 -07:00
Charles YaoandClaude Opus 4.8 37008011e2 feat(copilot): port run-fix handlers
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:04 -07:00
Charles YaoandClaude Opus 4.8 04f350d2e5 feat(copilot): port runner with version-CAS advance
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:04 -07:00
Charles YaoandClaude Opus 4.8 aa6eb92ac6 test(copilot): in-memory repository/dify/agent fakes
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:04 -07:00
Charles YaoandClaude Opus 4.8 95f2a11023 feat(copilot): port ports, value types, errors
Port dify-enterprise/server/pkg/enterprise/biz/copilot/{ports,errors}.go to
api/core/workflow_copilot as pure Python.

- errors.py: ConflictError, NotFoundError, BusyError (Exception subclasses,
  replacing Go's sentinel error values).
- models.py: add Diagnosis, Risk, MutationIntent, ChangeSet, NodeEvent,
  ApplyResult value dataclasses (Go: ports.go); tighten FixContext.diagnosis/
  staged_repair/risk/change_set from Any to these real types now that they
  live in the same module (avoids a models<->ports import cycle).
- ports.py: CopilotAgent / DifyPort / Repository as @runtime_checkable
  Protocols, snake_case methods per the port plan; DifyPort methods take
  actor: Actor instead of Go's ForwardAuth.
- test_ports.py: constructs each value type, asserts trivial stubs satisfy
  each Protocol via isinstance, and checks the error types.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:04 -07:00
Charles Yao 1b98b0fb29 feat(copilot): port domain models 2026-08-18 21:45:04 -07:00
Charles Yao d779b1629a feat(copilot): port PcState machine to api/core/workflow_copilot 2026-08-18 21:45:04 -07:00
zyssyz123 c38fb16efa fix(agent): retain usage for incomplete runs (#40937) 2026-08-18 13:11:22 +00:00
Asuka Minato 2400c6c59d test: migrate dataset service sessions and ORM models to SQLite (#40534) 2026-08-18 12:35:57 +00:00
Asuka Minato 4f81005662 test: migrate app runtime sessions and ORM models to SQLite (#40590) 2026-08-18 12:27:32 +00:00
Asuka Minato f2dfa462e1 test: migrate agent runtime sessions and ORM models to SQLite (#40587) 2026-08-18 12:26:58 +00:00
Asuka Minato 14bc28ffbe test: migrate residual controller sessions and ORM models to SQLite (#40579) 2026-08-18 12:26:33 +00:00
Asuka Minato 5afce305e7 test: migrate residual service and task ORM models to SQLite (#40576) 2026-08-18 12:26:01 +00:00