Skip to content

fix(team-mode): clarify team tool call semantics#4694

Open
WarGloom wants to merge 1 commit into
code-yeongyu:devfrom
WarGloom:fix/team-mode-tool-call-semantics
Open

fix(team-mode): clarify team tool call semantics#4694
WarGloom wants to merge 1 commit into
code-yeongyu:devfrom
WarGloom:fix/team-mode-tool-call-semantics

Conversation

@WarGloom

@WarGloom WarGloom commented Jun 2, 2026

Copy link
Copy Markdown

Summary

  • Clarifies team-mode tool descriptions so models understand async message delivery, task tracking, and the absence of message-history returns.
  • Makes team_create tolerate empty optional strings as omitted before enforcing the exact-one teamName/inline_spec rule.

Changes

  • Expanded team_create, task, message, query, and shutdown tool descriptions with concise model-facing semantics.
  • Normalized empty optional strings to undefined in team_create argument parsing.
  • Added regression coverage for team_create calls where tool callers include empty optional fields around valid teamName or inline_spec inputs.
  • Broadened the lifecycle test fixture parser to accept both string and object-shaped tool execution results.

Screenshots

N/A - tool schema/parser behavior only.

Testing

bun test src/features/team-mode/tools/tasks.test.ts src/features/team-mode/tools/query.test.ts src/features/team-mode/tools/messaging.test.ts src/features/team-mode/tools/lifecycle.test.ts src/features/team-mode/tools/lifecycle-inline-spec.test.ts
bun run typecheck
bun run build

Related Issues


Summary by cubic

Clarified team-mode semantics, especially task ownership and async messaging, so callers know what to pass and what each tool returns. team_create now treats empty optional strings as omitted while keeping the exactly-one-of teamName/inline_spec rule.

  • Bug Fixes

    • team_create: normalize empty strings for teamName, inline_spec, and leadSessionId to undefined before validation; tests cover both named and inline specs.
    • Test fixtures: parse tool results from either a raw JSON string or { output: string }.
  • Refactors

    • Tasks: team_task_update derives ownership from the caller session and ignores/removes the owner arg. Claim by setting status: "claimed" or "in_progress"; guidance and tests updated.
    • Tool descriptions: tightened across lifecycle, messaging, query, and tasks. team_send_message is async and returns delivery metadata (not replies/history). team_status/task tools do not return message bodies. Clarified team_delete cleanup and shutdown request/approve/reject flow, and when to omit empty optional args; team_create notes returned teamRunId and monitoring via team_status/team_task_list.

Written for commit ce4541c. Summary will update on new commits.

Review in cubic

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e74293af0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/features/team-mode/tools/tasks.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files

Confidence score: 3/5

  • There is a concrete behavior mismatch in src/features/team-mode/tools/tasks.ts: the tool advertises reassign, but the current logic does not apply reassignment (claimed ignores args.owner, and the non-claimed flow only validates current ownership).
  • Because this is a medium-severity, reasonably confident issue (6/10, 7/10) with user-facing impact, there is some regression risk if consumers rely on reassignment semantics.
  • Pay close attention to src/features/team-mode/tools/tasks.ts - reassignment behavior appears incomplete and may cause task ownership updates to be skipped.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/features/team-mode/tools/tasks.ts Outdated
@WarGloom WarGloom force-pushed the fix/team-mode-tool-call-semantics branch from 4e74293 to 0408cff Compare June 2, 2026 16:24
@WarGloom

WarGloom commented Jun 3, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 3, 2026
@MoerAI

MoerAI commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks @WarGloom, and for the careful write-up. There are two distinct things in here: a small parser fix (normalizing empty optional strings to undefined in lifecycle.ts before the exact-one teamName/inline_spec check), and a broad rewrite of the team-mode tool descriptions across lifecycle.ts, messaging.ts, query.ts, and tasks.ts.

The description rewrites change the model-facing tool semantics (what the LLM reads to decide how to call these tools), and the diff also drops the strict empty-leadSessionId rejection and its test. Those are behavior-surface and UX-judgment decisions rather than a single clear-cut bug, and at 6 files they are past the narrow fix() scope I merge autonomously. I would rather leave the call on the wording and the relaxed leadSessionId validation to the human maintainer.

I am not closing this, just holding it for the maintainer's review. If you would like to land the parser fix sooner, splitting the empty-string normalization into its own small PR (with the team_create empty-optional regression test) would be straightforward to merge on its own. No rush, and thanks again.

@WarGloom WarGloom force-pushed the fix/team-mode-tool-call-semantics branch from 0408cff to ce4541c Compare June 5, 2026 12:26
@WarGloom

WarGloom commented Jun 5, 2026

Copy link
Copy Markdown
Author

Updated this PR after review feedback.

Changes in the new push:

  • Rebases the branch onto current dev (base/dev).
  • Keeps the team_create empty optional string normalization and regression coverage after the lifecycle tool split.
  • Addresses the cubic/Codex tasks.ts finding by removing unsupported task reassignment wording.
  • Also removes the remaining unsupported ownership-assignment guidance from member-guidance.ts and the built-in team-mode skill.
  • Hardens team_task_update so it no longer exposes owner in its schema and always uses the caller session identity for updates.
  • Adds regression coverage proving a supplied owner value is ignored and caller identity wins.
  • Reviewed local/dev-stack overlap; did not import its broader live-delivery/task-semantics changes because they exceed this PR scope.

Verification:

  • LSP diagnostics clean on changed files.
  • bun test src/features/team-mode/tools/tasks.test.ts src/features/team-mode/tools/query.test.ts src/features/team-mode/tools/messaging.test.ts src/features/team-mode/tools/lifecycle.test.ts src/features/team-mode/tools/lifecycle-inline-spec.test.ts -> 62 pass / 0 fail.
  • bun run typecheck -> pass.
  • bun run build -> pass.
  • Final review-work -> passed all five lanes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants