Skip to content

fix(F148): background context_briefing renders as card instead of raw JSON#395

Open
mindfn wants to merge 4 commits intomainfrom
fix/briefing-render-bg
Open

fix(F148): background context_briefing renders as card instead of raw JSON#395
mindfn wants to merge 4 commits intomainfrom
fix/briefing-render-bg

Conversation

@mindfn
Copy link
Copy Markdown
Collaborator

@mindfn mindfn commented Apr 9, 2026

Summary

  • Background thread's system_info handler was missing the context_briefing branch, causing raw JSON to render as a plain system bubble instead of a BriefingCard
  • Added context_briefing consumer to useSocket-background-system-info.ts, mirroring the existing foreground logic in useAgentMessages.ts
  • Added regression test verifying briefing card message is stored correctly (not raw JSON)

Fixes #404

Test plan

  • Red-green: pnpm exec vitest run src/hooks/__tests__/useSocket-background.test.ts -t "stores the briefing card message" — red before fix, green after
  • Full suite: pnpm exec vitest run src/hooks/__tests__/useSocket-background.test.ts — 53/53 pass
  • Manual: open a background thread with briefing, confirm no raw JSON bubble

Credits

  • 🔍 Root cause + fix: 缅因猫/砚砚 (GPT-5.4)
  • 👀 Review: 布偶猫/宪宪 (Opus 4.6)

🐾 Generated with Claude Code

…ndler

Background thread's system_info handler was missing the context_briefing
branch, causing raw JSON to render as a plain system bubble instead of
a BriefingCard. Mirrors the existing foreground logic in useAgentMessages.

[砚砚/GPT-54🐾] [宪宪/Opus-46🐾]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mindfn mindfn force-pushed the fix/briefing-render-bg branch from a9d288b to f91933a Compare April 10, 2026 05:09
@mindfn
Copy link
Copy Markdown
Collaborator Author

mindfn commented Apr 10, 2026

@codex review

Please review latest commit f91933a for P1/P2 only.

规则:任何 P1/P2 必须给"可执行复现":

  • 优先:新增/更新一个 failing test(最小复现)
  • 否则:给确定性复现步骤(命令 + 输入 + 预期/实际)
    没有证据的一律降级为 P3 建议,不算缺陷。

审查标准(详见 AGENTS.md "Review guidelines" section):

  • P0 数据丢失/安全漏洞 | P1 逻辑错误/测试缺失/架构违规
  • P2 性能/重复/命名 | P3 风格偏好
  • 禁止 any、文件 200 行警告/350 硬上限、新功能必须有测试

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ 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".

@mindfn
Copy link
Copy Markdown
Collaborator Author

mindfn commented Apr 10, 2026

@codex review

Please review latest commit 5ad135d for P1/P2 only.

规则:任何 P1/P2 必须给"可执行复现":

  • 优先:新增/更新一个 failing test(最小复现)
  • 否则:给确定性复现步骤(命令 + 输入 + 预期/实际)
    没有证据的一律降级为 P3 建议,不算缺陷。

审查标准(详见 AGENTS.md "Review guidelines" section):

  • P0 数据丢失/安全漏洞 | P1 逻辑错误/测试缺失/架构违规
  • P2 性能/重复/命名 | P3 风格偏好
  • 禁止 any、文件 200 行警告/350 硬上限、新功能必须有测试

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ 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".

@mindfn
Copy link
Copy Markdown
Collaborator Author

mindfn commented Apr 10, 2026

@codex review

Please review latest commit 35b1852 for P1/P2 only.

规则:任何 P1/P2 必须给"可执行复现":

  • 优先:新增/更新一个 failing test(最小复现)
  • 否则:给确定性复现步骤(命令 + 输入 + 预期/实际)
    没有证据的一律降级为 P3 建议,不算缺陷。

审查标准(详见 AGENTS.md "Review guidelines" section):

  • P0 数据丢失/安全漏洞 | P1 逻辑错误/测试缺失/架构违规
  • P2 性能/重复/命名 | P3 风格偏好
  • 禁止 any、文件 200 行警告/350 硬上限、新功能必须有测试

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

💡 Codex Review

} catch {
// Best-effort: don't block operation if homedir legacy files are corrupt.

P2 Badge Propagate non-corrupt homedir migration failures

The new homedir fallback swallows every error via catch {}, even though the adjacent comment says only corrupt homedir files should be ignored; this hides deterministic filesystem failures and silently skips migration. Repro (deterministic): tmp=$(mktemp -d); mkdir -p "$tmp/proj/.cat-cafe" "$tmp/home/.cat-cafe/provider-profiles.json"; HOME="$tmp/home" node scripts/install-auth-config.mjs client-auth set --project-dir "$tmp/proj" --client openai --mode oauth; echo $? (input makes provider-profiles.json a directory, so reading it raises EISDIR). Expected: non-corrupt migration failure is surfaced (non-zero exit); actual: command exits 0 and continues, so legacy homedir data is skipped without any signal.

ℹ️ 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".

@mindfn
Copy link
Copy Markdown
Collaborator Author

mindfn commented Apr 10, 2026

Review triage for the reported P2 on scripts/install-auth-config.mjs:

So this finding points to existing main-branch behavior, not a regression introduced by the context_briefing fix in #395. Treating it as non-blocking for this PR.

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.

Bug: background thread context_briefing renders as raw JSON instead of BriefingCard

1 participant