Skip to content

fix: update optional dependencies to version 3.4.0 and optimize text …#1676

Closed
aliozdenisik wants to merge 0 commit intocode-yeongyu:devfrom
aliozdenisik:dev
Closed

fix: update optional dependencies to version 3.4.0 and optimize text …#1676
aliozdenisik wants to merge 0 commit intocode-yeongyu:devfrom
aliozdenisik:dev

Conversation

@aliozdenisik
Copy link

@aliozdenisik aliozdenisik commented Feb 8, 2026

Summary

  • Optimized text content extraction in delegate-task executor from 3x iteration to 1x iteration.
  • Extracted repeated filter().map().filter().join() chain into reusable extractTextContent() helper.
  • DRY refactor: Eliminated code duplication across 3 locations.

Changes

  • src/tools/delegate-task/helpers.ts: Added extractTextContent() helper function using single reduce() pass instead of chained array methods.
  • src/tools/delegate-task/executor.ts: Replaced 3 occurrences of duplicated pattern (lines 282, 410, 673) with the new helper.

Code Comparison

Before

const textParts = lastMessage?.parts?.filter((p) => p.type === "text" || p.type === "reasoning") ?? []
const textContent = textParts.map((p) => p.text ?? "").filter(Boolean).join("\n")

### After
const textContent = extractTextContent(lastMessage?.parts)

## Testing
bun run typecheck
bun test

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Updated optional oh-my-opencode packages to 3.4.0 and optimized delegate-task text extraction to a single pass with a shared helper. This reduces overhead and removes duplicate code in three places.

- **Refactors**
  - Added extractTextContent helper to collect text/reasoning in one reduce.
  - Replaced three filter/map/filter/join chains in executor with the helper.

- **Dependencies**
  - Bumped optional oh-my-opencode binaries to 3.4.0.

<sup>Written for commit a8a4f54428e332335491694e3e16e24cf7453fe5. Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

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

@aliozdenisik
Copy link
Author

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

github-actions bot added a commit that referenced this pull request Feb 8, 2026
Copy link

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

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

marlon-costa-dc pushed a commit to marlon-costa-dc/oh-my-opencode that referenced this pull request Feb 10, 2026
…imize text extraction

# Conflicts:
#	src/tools/delegate-task/executor.ts
#	src/tools/delegate-task/helpers.ts
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

Comments