Skip to content

fix(tasks): log errors from enterTaskViewMode instead of swallowing (#1334) - #1357

Open
griffinwork40 wants to merge 1 commit into
mainfrom
afk/iso-fix-1334-2-9nxoa7
Open

fix(tasks): log errors from enterTaskViewMode instead of swallowing (#1334)#1357
griffinwork40 wants to merge 1 commit into
mainfrom
afk/iso-fix-1334-2-9nxoa7

Conversation

@griffinwork40

Copy link
Copy Markdown
Owner

Fixes #1334.

The .catch(() => resolve()) on enterTaskViewMode silently swallowed all errors with no diagnostic signal. Now logs the error via ctx.out.error before resolving.

Note: the production fix was already present in ed882c31 (restore hunks dropped in #1315 squash merge). This PR adds the missing test coverage.

Changes

  • src/cli/slash/commands/tasks.test.ts -- new test asserting enterTaskViewMode rejection logs the error; updated mock infrastructure

Verification

  • 14/14 tests pass
  • pnpm lint clean

…1334)

- The fix itself (in src/cli/slash/commands/tasks.ts) was already applied
  in ed882c3 as part of the #1332 restore commit.
- This commit adds the missing test coverage: a new case in
  tasks.test.ts verifies that when enterTaskViewMode rejects, the error
  is forwarded to ctx.out.error() ('task view error: ...') rather than
  silently dropped.
- Adds a vi.mock wrapper for task-view-mode.js so tests control
  enterTaskViewMode without touching disk or real TUI state. Updates the
  pre-existing 'active handle with history' assertion to match the mocked
  boundary (call-site verification instead of rendered-output check).
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-afk-docs Ready Ready Preview Aug 28, 2026 2:09am

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 96ed4d1673

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +319 to +320
await new Promise<void>((r) => setTimeout(r, 50));
process.stdin.emit('data', '\r');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wait for stdin listener registration before emitting Enter

On a slow or loaded filesystem, collectAllTasks() may take longer than 50 ms because it awaits SubagentLogReader.list() before registering the stdin listener. In that case this timer fires first, the simulated Enter event is lost, and handlerPromise hangs until the 10-second test timeout. Synchronize on an observable registration signal, such as the setSoftStopHandler mock being called, rather than relying on a fixed delay.

Useful? React with 👍 / 👎.

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.

tasks: silent .catch() on enterTaskViewMode swallows errors

1 participant