Commit Graph
159 Commits
Author SHA1 Message Date
weichenandCursor ce95cd1355 Pin rebased native, squad, and core permission commits
ci / vet-and-test (pull_request) Successful in 40s
Why: Those three branches were replayed onto origin/main after the first pin.
Evidence: native 0a52d9f, squad beea97e, and core cf7df54 each contain origin/main.
Impact: The backend build uses the same commits that will be merged.
Refs: feature/permission-hooks
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 17:02:47 +00:00
weichenandCursor 6b0ff49f34 Gate tools by session mode and show confirmation details
Why: Plan mode has to block writes, confirmations dropped the argument preview, and direct chat did not share its stop gate with squad members.
Evidence: GOWORK=off go test ./internal/store/ ./internal/tools/ ./internal/runmgr/ ./internal/runtime/ ./internal/server/ passed. Default mode still runs write_artifact; plan mode rejects it.
Impact: Empty permission mode keeps the profile allow, deny, and confirm lists. High-risk shell commands now ask. There is no bypass-all mode.
Refs: feature/permission-hooks
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 17:01:46 +00:00
weichen 8f946e3094 Merge pull request 'Send an SSE retry interval and replay after overflow' (#57) from feature/runstate-shell into main
ci / vet-and-test (push) Successful in 40s
2026-10-03 16:41:40 +00:00
weichenandCursor 7bef7a4f94 Send an SSE retry interval and replay after overflow
ci / vet-and-test (pull_request) Successful in 40s
Why: A dropped subscription had no retry hint, and a reconnect had no test that the gap is filled from the cursor.
Evidence: The stream starts with retry: 1000. A live publish is delivered, and Last-Event-ID after an overflow replay skips events the client already has.
Impact: EventSource waits one second before reconnecting. Persisted events are unchanged.
Refs: feature/runstate-shell
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 16:35:34 +00:00
weichen 40728ab671 Merge pull request 'Cap tool results by character and gate stale file writes' (#56) from feature/context-engineering into main
ci / vet-and-test (push) Successful in 42s
2026-10-03 16:25:50 +00:00
weichenandCursor b2dc9a7e0b Pin agent-squad to the context-engineering native
ci / vet-and-test (pull_request) Successful in 38s
Why: The pin check requires backend's squad gitlink to match the Dev pin, and that squad commit carries the native context-engineering loop.
Evidence: deps/agent-squad is 4d53450, whose agent-native gitlink is 6fd1d44.
Impact: No backend behavior change beyond the shared native loop.
Refs: feature/context-engineering
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 16:22:32 +00:00
weichenandCursor 78ce78a7d3 Cap tool results by character and gate stale file writes
Why: Byte truncation split UTF-8, subagent results could return unbounded text, and a write could overwrite a file that changed after it was read.
Evidence: cutRunes keeps a two-character Chinese prefix; tool selection honors -name; checklist reminders go through the reminder bus.
Impact: Tool output limits count characters. A subagent result over 32000 characters is stored as an artifact and the parent sees the path. fs_write_file rejects an existing file that was not read in this run.
Refs: feature/context-engineering
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 16:21:02 +00:00
weichen 4e00c98cb5 Merge pull request 'Retry direct model calls before the first delta' (#55) from feature/llm-robustness into main
ci / vet-and-test (push) Successful in 42s
2026-10-03 15:56:15 +00:00
weichenandCursor 93adb93b9d Retry direct model calls before the first delta
ci / vet-and-test (pull_request) Successful in 40s
Why: The direct path never retried provider timeouts, so a single 429 failed the run.
Evidence: go test ./internal/settings/ ./internal/runtime/ passed. Default runtime.llmRetries is 2.
Impact: Retries happen only when the stream has not forwarded a delta. Injected test streams are not wrapped.
Refs: feature/llm-robustness
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 15:53:42 +00:00
weichen 28ccb741e4 Merge pull request 'Replay an open run from its first event' (#54) from fix/live-run-visibility into main
ci / vet-and-test (push) Successful in 42s
2026-10-03 15:25:37 +00:00
weichen cf44bd56b0 Merge origin/main into fix/live-run-visibility
ci / vet-and-test (pull_request) Successful in 41s
Why: The pull request cannot merge while the head is behind main.
Evidence: origin/main is 5d59ee9, one commit ahead of this branch.
Impact: Keeps the resume cursor and the interrupted-run recovery together.
Refs: Backend #54
2026-10-03 15:25:12 +00:00
weichenandCursor 51b1ff6923 Replay an open run from its first event
ci / vet-and-test (pull_request) Successful in 42s
Why: Refreshing or switching back only knew the latest event cursor, so process that had already happened was missing until the run finished.
Evidence: GOWORK=off go test -count=1 -run TestConversationResumeSeq ./internal/server passed. While a hitl run waits, resumeSeq is the run's first seq minus one and is less than lastSeq; after the run completes the two cursors match.
Impact: Conversation detail gains resumeSeq beside lastSeq. No core contract change. Clients that ignore the field keep the old cursor.
Refs: Dev fix/live-run-visibility
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 15:21:29 +00:00
weichen 5d59ee9d4f Merge pull request 'Recover interrupted runs and commit terminal state once' (#53) from feature/pi-durable-borrow into main
ci / vet-and-test (push) Successful in 43s
Recover interrupted runs and commit terminal state once
2026-10-03 14:44:38 +00:00
weichenandCursor 44aa764b56 Recover interrupted runs and commit terminal state once
ci / vet-and-test (pull_request) Successful in 43s
Why: A hard kill left runs in pending, running, or waiting_hitl, a busy send stored a message before the 409, finishRun could mark a run completed without an assistant message, and a full SSE buffer dropped events without closing the stream.
Evidence: GOWORK=off go vet ./... and GOWORK=off go test -count=1 ./... passed, including store, runmgr, bus, and server recovery tests.
Impact: Migration v14 adds runs.instance_id and messages.request_id. Startup reconciliation and shutdown share one seal. Turn and workflow sends claim a slot before writing. Duplicate request ids return the existing message. SettleRun updates the run and appends the assistant message in one transaction. A full subscriber buffer closes the channel so SSE can replay from the cursor.
Refs: Dev feature/pi-durable-borrow
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 14:37:49 +00:00
weichen 8fb3cae987 Merge pull request 'Wire the squad native adapter' (#52) from feature/agent-stack-d1 into main
ci / vet-and-test (push) Successful in 53s
2026-10-03 14:02:33 +00:00
weichen 0a9a9776d6 Pin native and squad to the SSE abort fix
ci / vet-and-test (pull_request) Successful in 42s
Why: Backend's nested checkouts have to match the native head that treats a cancelled stream as aborted.
Evidence: gitlinks only. The race test passed on d84a67c.
Impact: no Backend source change.
Refs: D1
2026-10-03 13:52:01 +00:00
weichen 5d0097d145 Pin native and squad to the aligned D1 heads
ci / vet-and-test (pull_request) Successful in 5m44s
Why: Backend's nested checkouts have to match the intent, native, and squad commits Dev will pin.
Evidence: gitlinks only. Internal package tests passed before this pointer move.
Impact: no Backend source change.
Refs: D1
2026-10-03 13:45:23 +00:00
weichenandCursor aa969aa747 Pin agent-squad to the adapter-only intent import
Why: Backend must build against the squad head that keeps agent-intent inside adapters/intent.
Evidence: the previous internal package tests passed on a182d76; this commit only moves the gitlink to f68e5bd.
Impact: no Backend source change.
Refs: D1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 13:43:09 +00:00
weichenandCursor b8e8cfb754 Wire the squad native adapter instead of the core registration
Why: Backend has to keep the same squad runs after the core stopped importing agent-native. The adapter module owns the concrete client.
Evidence: GOWORK=off go test -count=1 ./internal/... passed.
Impact: AgentNativeOptions now returns the adapter config. Default roles still use the agent-system backend.
Refs: D1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 13:42:04 +00:00
weichen 6d38f17302 Pin the three agent libraries to their R2 heads
ci / vet-and-test (push) Successful in 40s
Merge via API
2026-10-03 13:22:55 +00:00
weichenandCursor 6e30569cab Pin agent-native and agent-squad to the summed R2 heads
ci / vet-and-test (pull_request) Successful in 41s
Why: native 855fe41 records the golang.org/x/text sum that intent's NFKC import needs, and squad 31ee395 pins that native commit.
Evidence: GOWORK=off go vet ./internal/squadadapter/ ./internal/app/ passed against these heads.
Impact: two gitlinks move. Backend product code is unchanged.
Refs: I4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 13:13:58 +00:00
weichenandCursor a494375d58 Pin the three agent libraries to their R2 heads
ci / vet-and-test (pull_request) Successful in 42s
Why: backend must run against the intent, native, and squad commits that close this batch.
Evidence: agent-intent 05e74d8, agent-native 11d1a76, and agent-squad 1bb0c3a are the feature/agent-stack-r2 heads.
Impact: gitlinks move; backend product code is unchanged.
Refs: R2 pin
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 13:10:50 +00:00
weichen 9688fb9733 Merge pull request #50 from feature/agent-stack-r0-r1 into main
ci / vet-and-test (push) Successful in 43s
CI on the head commit is success.
2026-10-03 12:47:36 +00:00
weichenandCursor b365fd0f22 Install house-style Python packages before backend CI
ci / vet-and-test (pull_request) Successful in 43s
Why: TestLintErrorContinues imports the house-style linter, which needs python-docx, python-pptx, and openpyxl.
Evidence: Actions run 678 failed that test with ModuleNotFoundError: No module named docx after submodules checked out.
Impact: The packages come from the Tsinghua PyPI mirror. The test command is unchanged.
Refs: feature/agent-stack-r0-r1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 12:46:10 +00:00
weichenandCursor 26474b4752 Clone the repo in CI without GitHub-hosted actions
ci / vet-and-test (pull_request) Failing after 39s
Why: The runner cannot reach github.com, so a checkout action would time out before vet or test.
Evidence: The Go 1.27.1 tarball is available from mirrors.aliyun.com. Checkout uses the job token and GITHUB_SHA.
Impact: Submodule checkout still requires SUBMODULE_TOKEN. A missing secret fails the job with that message.
Refs: feature/agent-stack-r0-r1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 10:31:43 +00:00
weichenandCursor ef0a1bef0f Pin the three agent libraries to their pull request heads
ci / vet-and-test (pull_request) Failing after 4s
Why: Backend must call the library commits that include the hold fixes and the CI checkout change.
Evidence: intent 7f7879b06b053f0a62746309b79e0e1b9a00f42d, native 91c155618487e21edeb4f1d3cc27e985aae2b0d2, squad e928ea3c0fa649cbbbad22a93a1bc0a12dee5f7d.
Impact: The three gitlinks match the open pull request heads. Other pins are unchanged.
Refs: feature/agent-stack-r0-r1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 10:20:54 +00:00
weichenandCursor e14feb0321 Add a CI workflow that vets and tests the backend module
ci / vet-and-test (pull_request) Failing after 31s
Why: This repo had no workflow, so pull requests could not show a vet or test result.
Evidence: The job checks out submodules over HTTPS and runs GOWORK=off go vet ./... && GOWORK=off go test -count=1 ./... on Go 1.27 with GOPROXY=https://goproxy.cn,direct.
Impact: SUBMODULE_TOKEN must be set by the owner before checkout can succeed.
Refs: feature/agent-stack-r0-r1
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 10:19:56 +00:00
weichenandCursor 898fdd1371 Align library pins with the stack repair commits
Why: Backend still built against the pre-repair intent, native, and squad commits, so the host would not see the closed P0 and HTTP guard fixes.
Evidence: GOWORK=off go test -count=1 ./... passed with no code changes.
Impact: The backend module now tracks the same intent, native, squad, error-code, and logging commits as the Dev integration pins.
Refs: R1-d
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 01:54:27 +00:00
weichen 2d0b55391e Merge pull request 'Compose a separate final reply after the work loop' (#49) from feature/final-reply-compose into main 2026-10-02 14:15:17 +00:00
weichenandCursor 46d5f7b668 Keep artifact ids and byte counts out of the final reply
Why: The composed reply copied the registered artifact id and file size out of the tool summary.
Evidence: go test ./internal/runtime/ -run 'TestComposeUserPromptOmitsArtifactIDs|TestComposeReplyDropsInternalRefs'
Impact: Those tokens are removed from the compose input and from the reply before it is shown.
Refs: feature/final-reply-compose
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-02 14:02:19 +00:00
weichenandCursor 1512ae52cd Hide the compose model's reasoning from the user
Why: The first live run wrote its deliberation, including a think block and the quality score, as the reply the user sees.
Evidence: go test ./internal/runtime/ -run TestCompose
Impact: Think blocks are stripped before the reply is stored or shown. The compose prompt forbids paths, scores, and step-by-step reasoning.
Refs: feature/final-reply-compose
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-02 13:53:57 +00:00
weichenandCursor a506e137f6 Compose a separate final reply after the work loop
Why: End-of-turn checks were injected as user messages, so the model answered the checker instead of the user, and the last draft was treated as the reply.
Evidence: go test ./internal/runtime/ ./internal/prompts/ ./internal/settings/ ./internal/ctxasm/
Impact: Rejections are system reminders. A main-model compose step writes the user-facing reply when tools were used. Deliverable cards stay after that reply.
Refs: feature/final-reply-compose
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-02 13:37:54 +00:00
weichen b011a3337c Merge pull request 'Stream tool progress and drop hard agent limits' (#48) from feature/stream-display-overhaul into main 2026-10-02 05:05:02 +00:00
weichenandCursor cd74434b4f Stream tool progress and drop hard agent limits
Why: Tool calls stayed invisible until execution finished, and turn, tool, timeout, and output caps stopped long tasks early.
Evidence: go test ./internal/runtime/ ./internal/tools/ ./internal/prompts/ ./internal/squadadapter/ ./internal/runmgr/ ./internal/app/ ./internal/settings/
Impact: tool.call.delta and tool.output reach the client; default profile, subagents, and squad no longer cap turns or tool calls; exec timeout defaults to 600s with no hard ceiling. A profile or subagent maxTurns above 0 still applies.
Refs: feature/stream-display-overhaul
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-02 02:17:02 +00:00
weichen bc05bb2771 Merge pull request 'Execute intent, planned, and script workflows' (#47) from feature/agent-harness-p4 into main
Merge pull request #47
2026-10-02 01:03:55 +00:00
weichenandCursor 4b4be2be25 Run tool-started workflows with the script copy for that call
Why: A conversation run has no launch of its own, so a script step looked up an empty copy and refused to run.
Evidence: go test ./internal/runtime/ -run TestRegisteredWorkflowUsesItsOwnScriptCopy passed. The body is taken from the launch passed into the runner.
Impact: Intent-started runs still use the copy made at start.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 16:36:54 +00:00
weichenandCursor 7112ace34f Make the planner emit JSON and the critic enforce required lines
Why: The planner treated the goal as work to do, and the critic accepted a draft that missed the required line.
Evidence: go test ./internal/runtime/ ./internal/prompts/ passed. The planner task now says to output JSON and not perform the goal.
Impact: A missing required sentence is a failed check. The planner still cannot add script steps.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 16:32:03 +00:00
weichenandCursor 6026e248a6 Send step critic calls to the configured model
Why: The critic asked the provider for a model named verify, so every check failed before it could read the step output.
Evidence: go test ./internal/runtime/ -run TestJudgeUsesConfiguredModel passed. The request model is MiniMax-test when that is the configured chat model.
Impact: A missing lightweight route still falls back to the chat model. Unparseable output still counts as a fail.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 16:28:12 +00:00
weichenandCursor 10186ab916 Add a mock workflow script and load the example plugin
Why: Mock mode needs a path that drives the real step runner, and the example plugin should fail the host test if its workflow or slot question is wrong.
Evidence: go test ./internal/plugins/ -run TestRepoExamplePluginLoads passed. The brief intent asks 主题是什么? and keeps the topic slot.
Impact: #workflow is only the mock runner. The example plugin itself is in the Dev repo.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 16:21:50 +00:00
weichenandCursor fb5f071761 Run workflow scripts through a capped callback host
Why: Plugin scripts and model-written scripts need the same step runner, without giving the script a way to call interpreters or start another workflow.
Evidence: go test ./... passed. Callbacks, denied tools, the 50-call cap, a 1MB line, and cancel-kills-the-process are covered. A model script does not run until the switch is on and the user confirms.
Impact: runtime.workflowScripts stays off by default. Plugin script bodies are copied into the launch. Squad entry still has no run_workflow.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 16:18:59 +00:00
weichenandCursor 9a563df970 Confirm model-planned workflows before they run
Why: A goal should become steps only after the same limits as a declarative workflow, and only after the user accepts the plan.
Evidence: go test ./internal/runtime/ ./internal/prompts/ passed. Over-limit and script steps are rejected before confirmation. A no choice does not execute.
Impact: The planner profile is agent.sub.workflow-plan. run_workflow stays off subagent tool lists.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 16:11:51 +00:00
weichenandCursor 34da08874b Execute declarative workflow steps with a capped critic
Why: A matched intent needs to run the copied definition, ask for missing slots, and stop when a step or the whole workflow exceeds its retry cap.
Evidence: go test ./internal/runtime/ ./internal/runmgr/ ./internal/server/ ./internal/prompts/ passed. The five step kinds update the plan, an unparseable critic counts as a failure, and run_workflow by id runs the registered definition.
Impact: Squad entry does not declare run_workflow. Script steps still return an error until the script host lands. Goal and script arguments are rejected for now.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 16:10:05 +00:00
weichenandCursor ebeb6c599c Route a matched intent to its workflow after commands
Why: A hit intent should start the bound workflow, and a command that shares the same id still has to win.
Evidence: go test ./internal/intentgate/ ./internal/runmgr/ ./internal/server/ passed. Recognize keeps slots and the missing-slot question. StartWorkflowRun copies the definition and selects the workflow runner even when mock is on.
Impact: Ordinary turns are unchanged. The workflow runner body is still a stub until the executor lands.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 16:04:49 +00:00
weichenandCursor 63ea1a262c Register plugin workflows and drop them on uninstall
Why: Intent routing needs a registry of workflow definitions, and uninstall was leaving intents and workflows in place.
Evidence: go test ./internal/workflow/ ./internal/plugins/ ./internal/app/ passed. Validation rejects duplicate ids, unknown kinds, denied tools, and both step caps. Unregister clears the registry and the intent gate.
Impact: Script steps must stay inside the plugin directory. The server holds the registry for later routing.
Refs: feature/agent-harness-p4
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 15:59:54 +00:00
weichen dd199327b3 Merge pull request 'Let subagents run in the background and be reviewed' (#46) from feature/agent-harness-p3b into main 2026-10-01 15:51:54 +00:00
weichenandCursor 46ce1b2c8e Let subagents run in the background and be reviewed
Why: A parent turn should be able to finish while children keep working, and a review should keep only findings that a second pass confirms. Users also need to override a profile's tools, model, and turn cap without adding dispatch tools.
Evidence: go test ./... passed. New cases cover overlay rejection, role mapping, queued notices, and dropping FAIL or unparsed findings.
Impact: Notices live only in memory, and each conversation allows three background children. Squad writer steps now use the writer profile.
Refs: feature/agent-harness-p3b
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 15:29:01 +00:00
weichen 2c1a8994ef Merge pull request 'Run subagents through a depth-one tool loop' (#45) from feature/agent-harness-p3 into main 2026-10-01 14:50:49 +00:00
weichenandCursor 5051a069f7 Run subagents through a depth-one tool loop
Why: Subagents were a single lightweight call that dropped the hint and wrote their messages into the parent history. Profiles now decide tools, model, and turn cap, and the parent only keeps the summary plus confirmed artifacts.
Evidence: go test ./... passed. New tests cover the six builtin specs, tool execution and whitelist, explore versus writer models, maxTurns, artifact parts, hint text, SpawnAgent pinning, depth-1 refusal, summary artifact lines, and history isolation.
Impact: Squad steps share the general profile (up to 12 lightweight turns, no exec tools). Child runs do not attach the final-turn verifier. Profile fields stay in builtin files, so core.PromptModule is unchanged. The agent-native pin stays a34689c.
Refs: feature/agent-harness-p3
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 14:12:44 +00:00
weichen d407e4df22 Merge pull request 'Check final replies before the direct run stops' (#44) from feature/agent-harness-p2 into main 2026-10-01 14:00:52 +00:00
weichenandCursor a3ae1b986d Check final replies before the direct run stops
Why: A direct run could stop on a missing file, a failed lint, or an unverified claim. The final turn now checks registered artifacts and asks a tool-less verifier, and nudges stale plans and todos.
Evidence: go test ./... passed. New runtime tests cover missing and empty artifacts, docx lint errors, verifier reject-then-pass, unparseable and failed verifier calls, nil verifier tools, todo reminders, and the false-deliverable fixture.
Impact: Direct runs with runtime.verify (default on for new runs) spend one extra lightweight call on every final turn. Setting it off keeps the previous stop behavior. Squad and SubLLMRunner are unchanged. The agent-native pin stays a34689c.
Refs: feature/agent-harness-p2
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 13:54:15 +00:00