Skip to content

Bug: TypeError - undefined is not an object in titlecase function #1801

@wumajiehechuan-lab

Description

@wumajiehechuan-lab

Bug Description

When running tasks with oh-my-opencode, the application crashes with a TypeError in the locale utility.

Error Message

TypeError: undefined is not an object (evaluating 'str.replace')
    at titlecase (src/util/locale.ts:3:12)
    at task (src/cli/cmd/run.ts:170:24)
    at loop (src/cli/cmd/run.ts:452:15)

Environment

  • OS: Windows Server 2022 (Windows_NT 10.0.20348)
  • Node.js: v22.22.0
  • OpenCode: 1.1.56
  • oh-my-opencode: latest (installed via npm)

Steps to Reproduce

  1. Install oh-my-opencode: npm install -g oh-my-opencode@latest
  2. Configure with custom agents in ~/.config/opencode/oh-my-opencode.json
  3. Run any task: opencode run "test" or with ultrawork mode
  4. The error occurs during task execution

Configuration

{
  "$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
  "agents": {
    "Sisyphus": { "model": "kimi-for-coding/k2p5" }
  }
}

Expected Behavior

Task should execute without crashing.

Actual Behavior

Application crashes with TypeError in locale.ts titlecase function.

Additional Context

The error seems to occur when the str parameter passed to titlecase() is undefined instead of a string. This may happen during task delegation or agent initialization.

Workaround: None found yet - requires manual intervention to complete tasks.


感谢开发团队!如果需要更多调试信息,请告诉我。

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