Skip to content

refactor(fb15a): split task/index.ts into modules - #170

Merged
dirac-run merged 8 commits into
dirac-run:masterfrom
alexdim:fix/fb15a-task-index-split
Aug 13, 2026
Merged

refactor(fb15a): split task/index.ts into modules#170
dirac-run merged 8 commits into
dirac-run:masterfrom
alexdim:fix/fb15a-task-index-split

Conversation

@alexdim

@alexdim alexdim commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Extract eight focused modules from src/core/task/index.ts (reduced from ~1658 to ~140 lines):

  • TaskApiRequestAttempt.ts — attemptApiRequest split
  • TaskMistakeLimit.ts — mistake-limit handling
  • TaskPromptArtifacts.ts — prompt metadata artifact writing
  • TaskRequestBuilder.ts — buildApiRequestParams
  • TaskRequestLoop.ts — attemptApiRequest + recursivelyMakeDiracRequests
  • TaskRequestOutcome.ts — handleApiRequestError + processStreamResult
  • TaskSteering.ts — steering/checkpoint orchestration
  • TaskUserInput.ts — waitForFollowUp + submitCardResponse

Why

FIX-BACKLOG FB-15a — single responsibility: each module owns one concern.

Review follow-up

  • Rebased onto current master (was 36 behind + conflicting).
  • Two conflicts resolved in index.ts (master evolved buildApiRequestParams and recursivelyMakeDiracRequests — kept the PR's delegate-call pattern).
  • Full task-suite run published.

Task-suite results (rebase head)

656 passing (2s)
2 failing
  • Failure 1: SourceAstTraitBuilder — pre-existing assertion mismatch, confirmed on master.
  • Failure 2: SubagentRunner afterEach — pre-existing TCC EPERM (AgentConfigLoader watches ~/Documents/Dirac), env-specific.

Zero new failures from this PR.

Changes

  • 8 new task modules (listed above)
  • src/core/task/index.ts — reduced to thin delegates
  • tsconfig.unit-test.json — test glob adjustment

Verification

  • tsc -p tsconfig.unit-test.json --noEmit — only pre-existing baseline error.
  • Task suite: 656/658 passing, 0 new failures.
  • Rebased cleanly onto master, 0 behind.

Closes FB-15a (FIX-BACKLOG).

@dirac-run dirac-run left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The #166 dependency is now resolved. This branch also contains #169's test commit, so the clean sequence is to merge #169 first and let GitHub reduce this PR to the task-loop extraction. I found no concrete semantic drift in the static review, but because this moves a large part of the core request loop, please provide a visible full task-suite result before merging.

@dirac-run

Copy link
Copy Markdown
Owner

Follow-up needed:

The dependencies are now merged, and the effective diff is correctly reduced to the eight task modules plus src/core/task/index.ts. However, the current head is conflicting with master and is 36 commits behind; src/core/task/index.ts has also changed on master.

Please rebase or otherwise update this branch onto current master, resolve the conflict, and publish a visible full task-suite result from the updated head. Once that is done, request re-review.

devin-ai-integration Bot and others added 8 commits August 13, 2026 00:44
- Moves claim/commit/rollback/settle/enqueue/append/restore helpers
  out of src/core/task/index.ts into a focused helper module.
- Keeps Task class as a thin façade that delegates via a context
  object, preserving the existing public/private method surface.
- Verified: core/task tests 283 passing, tsc baseline unchanged, biome clean.

Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…s.ts

- Moves the ~120-line writePromptMetadataArtifacts implementation out of
  src/core/task/index.ts into a side-effect-isolated helper module.
- Task.writePromptMetadataArtifacts becomes a thin façade; DiracContext
  receives an arrow wrapper so the public callback shape is preserved.
- Verified: core/task tests 283 passing, tsc baseline unchanged, biome clean.

Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…skRequestOutcome.ts

Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…to helpers

Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…nput.ts

Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
…to TaskRequestLoop.ts

Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
Co-Authored-By: Alexandros Salapatas <alexsal.alex@gmail.com>
@alexdim
alexdim force-pushed the fix/fb15a-task-index-split branch from 03f862f to a32675a Compare August 12, 2026 21:46
@dirac-run

Copy link
Copy Markdown
Owner

Two behavior gaps remain in the extracted TaskRequestBuilder:

  1. promptContext.utilityModelConfigured is not carried forward from current master, so configured users lose the use_utility_model parameter from subagent tool schemas.
  2. The request path no longer invokes writePromptMetadataArtifacts(), disabling the opt-in per-request prompt artifact feature.

I’m merging this and will fix both forward before release by restoring the omitted request-builder wiring and adding focused regression coverage.

@dirac-run
dirac-run merged commit 50aa23a into dirac-run:master Aug 13, 2026
@alexdim
alexdim deleted the fix/fb15a-task-index-split branch August 13, 2026 20:08
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