#19674: test: allow optional session key in subagent announce mock
agents
size: XS
Cluster:
Subagent Task Management Fixes
Fix TS2345 in subagent-announce.format.e2e.test by allowing undefined sessionKey in chatHistoryMock.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixes TypeScript compilation error TS2345 in test mock by making the `sessionKey` parameter optional in `chatHistoryMock`. The mock is called with potentially `undefined` sessionKey (`typed.params?.sessionKey` on line 71), so the parameter type needed to accept optional values to match actual usage.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no risk
- Single-line test-only change that fixes a legitimate TypeScript type error without affecting any production code or test behavior
- No files require special attention
<sub>Last reviewed commit: 365ac48</sub>
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#7584: Tests: align subagent announce wait expectations
by justinhuangcode · 2026-02-03
79.5%
#19679: fix: handle optional sessionKey in subagent-announce test mock
by 88plug · 2026-02-18
78.9%
#14309: fix(ui): resolve chat event session key mismatch
by justonlyforyou · 2026-02-11
76.5%
#20072: feat(sessions_spawn): add sessionKey param to reuse sub-agent sessions
by Be1Human · 2026-02-18
76.1%
#15792: fix: pass agentId to resolveSessionFilePath in additional call sites
by MisterGuy420 · 2026-02-13
75.8%
#16964: test: add regression tests for sub-agent session path resolution
by StressTestor · 2026-02-15
75.3%
#8471: fix(subagent): add defensive checks for undefined string fields
by adam-smeth · 2026-02-04
75.3%
#17788: fix: correct config path in sessions_spawn error hint (v2)
by Limitless2023 · 2026-02-16
75.1%
#23594: test(tui): fix mock typing in command handler tests
by Sashamine · 2026-02-22
74.9%
#8774: Fix/frontend session key normalization
by zhaodageng · 2026-02-04
74.7%