Fix dictation prompt initialization order #6836

Closed
opened 2026-02-16 18:05:24 -05:00 by yindo · 1 comment
Owner

Originally created by @adolago on GitHub (Jan 19, 2026).

Originally assigned to: @rekram1-node on GitHub.

Problem

Dictation command labels and hints are accessed before initialization, causing a TDZ crash when the prompt mounts.

Proposed fix

  • In packages/agent-core/src/cli/cmd/tui/component/prompt/index.tsx, move dictationKey, dictationCommandLabel, dictationCommandDisabled, dictationHintLabel, and dictationHintColor above the first command.register call.

Acceptance criteria

  • The TUI prompt loads without a ReferenceError for dictation fields.
  • Dictation command labels render based on the current dictation state.

Test plan

  • cd packages/agent-core
  • bun dev -- --no-daemon --agent zee --prompt "List my calendar events today."
Originally created by @adolago on GitHub (Jan 19, 2026). Originally assigned to: @rekram1-node on GitHub. ## Problem Dictation command labels and hints are accessed before initialization, causing a TDZ crash when the prompt mounts. ## Proposed fix - In `packages/agent-core/src/cli/cmd/tui/component/prompt/index.tsx`, move `dictationKey`, `dictationCommandLabel`, `dictationCommandDisabled`, `dictationHintLabel`, and `dictationHintColor` above the first `command.register` call. ## Acceptance criteria - The TUI prompt loads without a `ReferenceError` for dictation fields. - Dictation command labels render based on the current dictation state. ## Test plan - `cd packages/agent-core` - `bun dev -- --no-daemon --agent zee --prompt "List my calendar events today."`
yindo closed this issue 2026-02-16 18:05:24 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #8064: 'prompt.set' error still occurring (similar undefined variable access in prompt)
  • #7918: Crash when local.agent.current() returns undefined during startup/auth (similar TDZ/initialization timing issue)
  • #8106: fatal: undefined is not an object (evaluating 'input.setText') (similar undefined access in prompt component initialization)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #8064: 'prompt.set' error still occurring (similar undefined variable access in prompt) - #7918: Crash when local.agent.current() returns undefined during startup/auth (similar TDZ/initialization timing issue) - #8106: fatal: undefined is not an object (evaluating 'input.setText') (similar undefined access in prompt component initialization) Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6836