Make task_comment mode explicit - #95
Open
k2v7n24cbf-cyber wants to merge 1 commit into
Open
Conversation
k2v7n24cbf-cyber
marked this pull request as ready for review
July 17, 2026 11:59
k2v7n24cbf-cyber
added a commit
to k2v7n24cbf-cyber/openacme
that referenced
this pull request
Jul 22, 2026
Merge staged copy of sandydasari#95 into local-stage.
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.
Make
task_commentmode explicit and hide legacykindSummary
kindparameter withmode: "comment" | "result".modeto ordinary comments.kind: "result"accepted in the handler for older/direct callers,but stops advertising it to agents.
template from
kind: "result"tomode: "result".modeto storedkindmapping and updates theserver e2e task-comment fixture to use the new model-facing contract.
Reason / RCA
Agents were overusing
kind: "result"for progress updates even when sharedcontext told them ordinary progress comments should omit
kind.Observed Behavior
In a live OpenAcme deployment running agents on
gpt-5.5, this pattern wasseen across nearly all deployed agents: ordinary coordination progress was
posted as comments rendered under the Result label.
filing a child task, but it was posted as a result.
accidentally posted with result-kind, but that correction was also posted as a
result.
This showed that prompt/context discipline alone was insufficient. The agent
understood the distinction in prose, but the exposed tool schema still pushed it
toward the only explicit enum value:
kind: "result".The first mitigation only strengthened the prose. Live behavior showed that was
not enough: an agent still posted ordinary progress as a Result, then posted a
second Result saying the first one was accidental.
The root cause is therefore the model-facing contract, not only the prompt text:
task_commentis not an external MCP tool. It is an always-on OpenAcme systemtool, merged into every agent's effective tool set.
kindfield with exactly one visible value:"result".kind, which is lesssalient to the model than selecting the only enum value shown in the schema.
"result"looklike the only explicit comment mode.
warning and onboarding task template that still taught
kind: "result".This made agents treat
kindas a general "comment type" field and reach for"result"whenever a comment felt important, even if it was only a progressupdate. The fix gives agents two explicit modes and makes the safe ordinary path
the default.
Code Observations
packages/tools/src/system.tsliststask_commentandtask_commentsinSYSTEM_TOOLS, so every agent sees the task tools regardless of configurableMCP/tool settings.
AgentManager.createAgentFromDefmerges configured tools, MCP tools, andSYSTEM_TOOLS.ToolRegistry.getVercelTools()passes each tool's Zod schema and descriptioninto the model-facing tool block.
task_commentpreviously stored ordinary comments askind: nullviakind: a.kind ?? null.kind; reserved namedkinds are
"result"and"system".latestResult()reads the most recentkind: "result"comment. This PR doesnot add a duplicate-result restriction, preserving the current correction /
follow-up behavior.
task_updatecan emit a missing-result warning; that warning is alsomodel-visible because agents receive tool results.
packages/agent-catalog/templates/acme/resources/onboarding-task.mdis seedguidance for new agents, so it must use the same mode terminology.
packages/server/test/e2e/tasks.e2e.tsmocked the previous advertisedkind: "result"shape; it now covers the newmode: "result"interfaceexpected from agents.
Implementation Notes
This deliberately keeps one tool:
task_comment({ "id": 123, "body": "Progress: validating extraction.", "mode": "comment" })or omit
modefor ordinary comments:task_comment({ "id": 123, "body": "Progress: validating extraction." })Use result mode only for the assignee's final canonical answer before marking
the task done:
task_comment({ "id": 123, "body": "Final answer: ...", "mode": "result" })No storage schema, permission rule, or comment read behavior changes. Stored
ordinary comments remain
kind: null; result comments remainkind: "result".Legacy direct callers passing
kind: "result"still work.Validation
pnpm --filter @openacme/tools test -- tasks.test.tspnpm --filter @openacme/tools build && pnpm --filter @openacme/agent-core buildpnpm --filter @openacme/agent-catalog buildpnpm --filter @openacme/server test:e2e -- tasks.e2e.tstests.
task_commentkeys:id,body,modekindis not present in the advertised schemamodestoreskind: nullmode: "comment"storeskind: nullmode: "result"storeskind: "result"kind: "result"still storeskind: "result"