feat(team-work): one-call LLM routing classifier with native DAG orchestration - #1495
Open
nguyenha935 wants to merge 1 commit into
Open
feat(team-work): one-call LLM routing classifier with native DAG orchestration#1495nguyenha935 wants to merge 1 commit into
nguyenha935 wants to merge 1 commit into
Conversation
nguyenha935
force-pushed
the
feat/team-work-native-orchestration
branch
from
August 2, 2026 12:33
e652d58 to
dcc8ad6
Compare
nguyenha935
marked this pull request as ready for review
August 2, 2026 13:37
…ution Team Work enforcement: a single classification call decides self / single_owner / multi_role plus independent review, executing through the native GoClaw DAG, lease/retry, finalize and exactly-once delivery. No duplicate scheduler; no embedding requirement for the classifier. Rebased onto current dev: SQLite migrations renumbered to 60-62 (schema_version 63), Postgres migrations 000098-100 (live DB migrated 99->100 cleanly, dirty=false). Delivery fixes validated live (v3.15.0-beta.197-patch.8bf57ec3a4): - workflow finalize forwards terminal-task attachments as outbound media so requested files reach the user channel instead of being dropped; - terminal integration step returns the full markdown answer with newlines/formatting preserved instead of a collapsed one-liner. Live e2e on bao-an: 3-node gold-price run (research -> draft -> QA) completed, QA issues fixed by lead, markdown report written and final answer delivered with correct formatting; all 3 task attachments recorded in team_task_attachments; health gate and channels OK.
nguyenha935
force-pushed
the
feat/team-work-native-orchestration
branch
from
August 23, 2026 03:15
dcc8ad6 to
b91917d
Compare
Contributor
Author
Update: rebased onto current dev + delivery fixes validated liveHead: b91917d (rebased on fc8a35e = dev tip) What changed in this force-push
Live e2e validation (VPS, v3.15.0-beta.197-patch.8bf57ec3a4)
Verification
|
clark-cant
requested changes
Aug 23, 2026
clark-cant
left a comment
Contributor
There was a problem hiding this comment.
Maintainer reviewnnVerdict: Request changesnnThis PR is clean and the three CI checks are green, but it remains too large to approve safely as one change: 323 files and +40,435/-1,953 lines alter routing, scheduler admission, workflow persistence/recovery, delivery semantics, pipeline lifecycle, gateway behavior, API/protocol, UI, migrations, and locales together. This prevents a reliable review or rollback boundary.nnPlease split it into independently buildable, testable PRs (at minimum: schema/store migrations; classifier/config; native DAG/workflow execution; scheduler/pipeline lifecycle; delivery semantics; UI/protocol). Each PR should carry focused integration tests and a clear compatibility/rollback statement. The current branch should be rebased/sliced without mixing unrelated lifecycle and delivery changes with the Team Work feature.nnMandatory gatesn- Duplicate/prior work: no duplicate found in metadata review.n- Project standards: CI green, but focused reviewability and release safety are not met.n- Strategic necessity: plausible high value, but the combined operational blast radius is too high.nnPosted by github-maintain at 2026-08-23T05:53:19Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete Team Work orchestration feature: a single LLM routing call classifies each new request (
self/single_owner/multi_role, plus an independent-review decision) and executes multi-agent work on GoClaw's native DAG, lease/retry, finalize and exactly-once delivery — with no duplicate scheduler and no embedding requirement. This is the full feature developed and validated across prior phases; the final phase removed the classifier's embedding dependency.Type
main)Target Branch
devWhat's included
Classifier (one LLM call before execution)
internal/teamworkclassify/—ClassifyRouteWithLLMmakes exactly one routing LLM call (routing.go), producingdecision(self/team),workflow_mode(self/single_owner/multi_role), andreview_required. Roster/tool profiles feed the prompt from stores (context.go,roster.go);planner.govalidation andshape.goretained for stored workflows.internal/providerresolve/team_work_classifier.go— per-tenant provider/model override resolution.internal/teamworkconfig/— per-tenant classifier settings resolver (enable/provider/model/timeout), replacing the cross-tenant shared-cfg overlay.Native DAG execution (no duplicate scheduler)
team_workflows), 97 (team_task_notification_policy), 98 (team_work_enforcement);RequiredSchemaVersionbumped to 98.internal/store/pg/+internal/store/sqlitestore/—team_workflows,team_workflows_actions,team_workflows_recovery,team_workflows_attempt,team_work_classification_audits(dual-DB parity).internal/tools/team_tasks_create_dag.go— DAG creation overteam_tasks.blocked_by; independent-review enforcement invalidateReviewTasks(fail-closed whenreview_required=falsebut a review task is declared).cmd/gateway_workflow_finalize.go,cmd/gateway_workflow_recovery.go— finalize and blocker-recovery runs, enqueued onto the native scheduler (scheduler.LaneSubagent), not a private scheduler.Scheduler / dispatch / finalize integration (changed, accurately described)
internal/scheduler/— added a scheduler-ownedPreExecutedequeue hook and a single-pump ordered FIFO admission (queue.go) with lane-submit serialization and a shutdown race guard inlanes.go. These are extensions to the existingSchedulerstruct; there is exactly oneSchedulertype in the tree — no duplicate scheduler is introduced.internal/pipeline/— finalize/think/tool/prune stage hooks carryingAbortReasonand empty-response fallback so a failed/aborted run cannot wedge an agent.internal/providers/—EmptyResponseErrorinvariant,FailoverSummaryError.Unwrap, and retry classification so a dead stream no longer reads as a successful empty answer.internal/channels/dispatch.go+internal/bus/types.go—DeliveryAck+EventIDfor bounded at-least-once transport with receiver dedup; durable retry state stays in the workflow store.finalize_token/finalize_lease_until/finalized_atanddelivery_token/delivery_status/delivered_atCAS columns (migration 98).Embedding decoupling (final phase)
Embedder/Evidence/TeamWorkEmbedderplumbing and dead compatibility fields (SelfScore,CollaborationScore,EmbeddingAvailable/Reason,CloseMargin,TeamThreshold,DefaultCloseMargin,defaultTeamThreshold,defaultEvidenceTimeout) from the classifier and all gateway/cmd wiring.behavior-ux-card.tsx,system-settings-modal.tsx).Retained, intentionally unchanged
setupMemoryEmbeddings(memory, KG, vault, skill, semantic task search) anduseEmbeddingStatusUI consumers.planner.gostored-workflow validation; the nativeSchedulercore; dispatch/lease primitives.UI / config / API / locales / tests
pkg/protocolteam events/methods, permissions policy entries, i18n catalogs (5 locales).BehaviorUxCardrender+click regression (mutation-verified).Not included (kept out of this PR)
Dockerfile,go.mod,SHA256SUMS.txt,internal/agent/extractive_memory{,_vi_test}.go,internal/providers/defaults{,_timeout_test}.go— infra/separate-patch files, left untouched in the worktree.Checklist
go build ./...passesgo build -tags sqliteonly ./...passesgo vet ./...passesgo test -race ./...— see note belowcd ui/web && pnpm build$1, $2internal/upgrade/version.go(96→98)go test -race ./...note (disclosed, not hidden)-racereports zeroDATA RACEanywhere. Three packages did not complete green under-racein the local container:internal/gateway/methods→TestTurnIntegration_CancelledRunProducesNoResult: timing flake — a fixed 2s wait for the run to reach its agent turn expires under race instrumentation overhead; passes without-race(ok ... 11.0s). No data race.internal/hooks/handlers:signal: killed(container resource/timeout), unrelated to this feature.internal/http: 5 Ollama model tests fail onhost.docker.internalDNS resolution — environment-only in this container; known to pass on CI.All non-race builds,
go vet, and the feature package tests are green.Test Plan
go build ./...,go build -tags sqliteonly ./...,go vet, targetedgo test(teamworkclassify, teamworkconfig, gateway/methods, config, cmd, tools, agent) — all pass.pnpm install --frozen-lockfile(lockfile byte-identical),pnpm test(60 files / 375 tests),pnpm build— all pass.Immutable deployment + rollback (live host)
goclaw-runtime:embedding-decoupled-20260802(sha256:59261928…) from this worktree with embedded UI; rollback taggoclaw-runtime:rollback-pre-embedding-decoupled-20260802pinned to the previously runningsha256:67ddf3dcce70.--no-deps); PostgreSQL untouched — containerf7d88d07b81b,StartedAt 2026-07-31T11:23:44Zunchanged.{"status":"ok","protocol":3}, schema98 | dirty=false, UIGET /→ 200.Live T1–T4 classifier matrix (one decision log per session)
Exactly one classifier decision log per session (audit count 293 → 297). DAG review-task proof: T2 has 1 review task / 4 tasks; T4 has 0 review tasks / 3 tasks —
review_required=falseproduces no review task.