Skip to content

[WS1.1] Reduce processor.ts and prompt.ts diff — investigate mixed changes #164

@randomm

Description

@randomm

Parent: #158

Context

The full fork audit revealed these files have large diffs that are a mix of async-task changes and general fork improvements:

File Diff lines Content
processor.ts 692 lines (+331/-281) Stream loop try/catch, BackgroundTasks import, AbortError handling, error typing improvements
prompt.ts 387 lines (+111/-61) Task injection, sanitize helpers, auto-wakeup, reject callback, OTHER-FORK improvements

Problem

These files change frequently upstream (prompt.ts: 78 commits in 3 months). Every unnecessary line of diff increases conflict risk during sync.

Goal

For each file, separate changes into:

  1. ASYNC-TASK — must keep (imports, task injection, auto-wakeup hooks)
  2. FORK-IMPROVEMENT — evaluate: is the improvement worth the maintenance cost?
  3. UPSTREAM-DRIFT — discard: accept upstream's version for formatting/style changes

prompt.ts breakdown (from analysis)

  • ASYNC-TASK: ~55 lines → keep
  • OTHER-FORK: ~95 lines → evaluate each
  • UPSTREAM-DRIFT: ~35 lines → discard (accept upstream formatting)
  • Target: reduce from 387 to ~150 lines

processor.ts breakdown

  • Needs investigation — classify each hunk
  • Target: minimize to only async-task hooks

Acceptance Criteria

  • processor.ts classified hunk-by-hunk
  • Non-essential changes reverted to match upstream
  • Remaining diff is only async-task code
  • Typecheck + tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions