Skip to content

[Medium] Fix code style violations (any types, magic numbers) #16

@randomm

Description

@randomm

Problem

Code review found style violations:

Using `any` Type

  • loop.ts lines 344, 354: item.execute as any
  • Fix: Define proper ToolExecutor type

Magic Numbers

  • stream.ts line 103: part.text.length > 200
  • loop.ts line 371: userText.length < 10
  • stream.ts line 181: text.length < 50
  • Fix: Extract to named constants with comments

Silent Tool Skip

  • loop.ts line 355: if (!originalExecute) continue - no warning logged
  • Fix: Log which tools were skipped for diagnostics

Files

  • packages/opencode/src/core/loop.ts
  • packages/opencode/src/core/stream.ts

Branch

claude/simplify-agentic-loop-2jRSP

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