Skip to content

Reuse ordinary workspace tools in group runs#786

Closed
Y1fe1Zh0u wants to merge 2 commits into
dataelement:mainfrom
Y1fe1Zh0u:refactor/unify-group-workspace-tools
Closed

Reuse ordinary workspace tools in group runs#786
Y1fe1Zh0u wants to merge 2 commits into
dataelement:mainfrom
Y1fe1Zh0u:refactor/unify-group-workspace-tools

Conversation

@Y1fe1Zh0u

Copy link
Copy Markdown
Collaborator

What changed

  • Add workspace_scope=agent|group to ordinary file tools during Group Runs.
  • Route Group Workspace list/read/document/search/find/write/edit/delete operations through the existing file-tool names while preserving group authorization, durable mutation fencing, and reconciliation.
  • Remove the four legacy Group Workspace file tools from new model contracts while retaining execution compatibility for in-flight checkpoints.
  • Keep group_query_members, group_read_announcement, group_read_memory, and group_write_memory unchanged.
  • Reuse the ordinary read_document parser for Group Workspace binary files.
  • Fix PPTX extraction failing with 'list' object has no attribute 'rId' by iterating python-pptx slides without slicing.

Why

Group runs exposed a second file-tool namespace whose UTF-8-only reader could not parse PDF, DOCX, XLSX, or PPTX files. Models also had to choose between overlapping private and group tool families. A single file-tool surface with an explicit workspace scope keeps the authorization boundary while removing the duplicated model contract.

The PPTX failure was an independent bug in the shared parser: prs.slides[:50] passes a slice through python-pptx as one slide identifier, which later attempts to access .rId on a list.

Impact

  • Group files can use the same document-reading and text mutation workflow as Agent Workspace files.
  • Existing persisted legacy Group Workspace calls remain recoverable.
  • move_file remains Agent-Workspace-only until Group Workspace supports one durable operation covering both source deletion and target creation.
  • Picture-only PPTX decks still require OCR or vision processing; this PR fixes the parser exception but does not add OCR.

Validation

  • 2071 passed across the complete backend test suite after rebasing onto the deployed d7030db3 baseline.
  • Added generated PPTX regression coverage reproducing and preventing the list/rId failure.
  • Parsed the reported 1.99 MB Group Workspace PPTX by exact SHA-256 in the live 3010 backend without an exception.
  • Deployed commits 426e5060 and 6c6c6373 to the 3010 test environment.
  • Verified backend health, zero container restarts, Alembic head, LangGraph checkpoint version 9, and the live tool contract.

Group workspace files now share the ordinary file-tool surface through an explicit workspace scope, while the four group business tools remain unchanged. Legacy group workspace names stay execution-compatible for in-flight checkpoints but are removed from new model contracts. Document reads reuse the existing binary parser and mutations retain durable fencing and reconciliation.

Constraint: Group storage authorization and mutation receipts remain separate from private Agent Workspace storage.

Rejected: Expose a second generation of group-specific file tools | it repeats the namespace-selection failure and still leaves write/edit parity unresolved.

Confidence: high

Scope-risk: moderate

Reversibility: clean

Directive: Do not add Group Workspace move_file until source deletion and target creation can be reconciled as one durable operation.

Tested: 2057 backend tests; focused group runtime, model step, tool step, reconciler, builtin contract tests; Ruff; py_compile; diff check.

Not-tested: Live 3010 group chat flow before deployment; real S3/Cloudflare document parsing path.
The Slides collection treats slice objects as one slide identifier, which makes ordinary read_document fail with a list/rId exception. Iterate slides normally and stop after the existing 50-slide safety limit.

Constraint: Preserve the existing text-only PPTX extraction contract and 50-slide bound.

Rejected: Add OCR for picture-only decks | outside this parser bug fix and materially expands runtime cost.

Confidence: high

Scope-risk: narrow

Reversibility: clean

Tested: Reproduced the list/rId failure; added a generated two-slide PPTX regression; parsed the reported 1.99MB file without exception; 2071 backend tests passed.

Not-tested: OCR for image-only slides; authenticated browser retry after deployment.
@Y1fe1Zh0u Y1fe1Zh0u closed this Jul 24, 2026
Y1fe1Zh0u added a commit that referenced this pull request Jul 24, 2026
Integrate the shared PR #786/#787 head once so ordinary workspace tools can be exercised against group scope without duplicating identical history.

Constraint: PR #786 and #787 resolve to the same head commit 6c6c637
Rejected: Create two merge commits for one commit | duplicate ancestry would add no product change
Confidence: high
Scope-risk: moderate
Tested: Merge completed without conflicts
Not-tested: Combined backend regression suite pending
Y1fe1Zh0u added a commit that referenced this pull request Jul 24, 2026
Waiting-to-cancel transitions can emit distinct delivery receipts from one preserved checkpoint, while legacy group members may no longer resolve an Agent model. Narrow checkpoint uniqueness only for delivery receipts and let shared compaction fall back to the configured Group Compact model when no active Agent model remains.

Constraint: Control-plane cancel must preserve the last authoritative Graph checkpoint

Rejected: Fabricate a cancel checkpoint | violates the existing Runtime checkpoint contract

Confidence: high

Scope-risk: narrow

Reversibility: clean before distinct same-checkpoint delivery rows are written

Directive: Keep delivery idempotency keyed by run_id and idempotency_key

Tested: 110 targeted backend tests, Alembic head validation, Python compileall, scoped Ruff

Not-tested: Live 3010 migration and reconciliation before commit

Related: #785 #786 #787 #788
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.

1 participant