Skip to content

fix(atlas): address review findings for task session reuse#2676

Merged
code-yeongyu merged 1 commit intodevfrom
fix/atlas-task-session-review-followup
Mar 18, 2026
Merged

fix(atlas): address review findings for task session reuse#2676
code-yeongyu merged 1 commit intodevfrom
fix/atlas-task-session-review-followup

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented Mar 18, 2026

Summary

Follow-up fixes for PR #2640 review findings (atlas task session reuse).

  • Add dedicated unit tests for top-level-task.ts parser (12 test cases covering all edge cases)
  • Broaden session ID regex to accept hyphens (ses_[a-zA-Z0-9_-]+)
  • Add __proto__/constructor/prototype guard in upsertTaskSessionState
  • Replace unsafe as string | undefined casts with typeof narrowing in tool-execute-after.ts

Changes

File Change
src/features/boulder-state/top-level-task.test.ts NEW - 12 comprehensive unit tests
src/hooks/atlas/subagent-session-id.ts Regex broadened for hyphenated IDs
src/hooks/atlas/subagent-session-id.test.ts Added hyphenated ID test case
src/features/boulder-state/storage.ts Reserved key guard for prototype pollution
src/hooks/atlas/tool-execute-after.ts typeof narrowing instead of casts

Verification

  • bun run typecheck - pass
  • bun test top-level-task.test.ts subagent-session-id.test.ts - pass
  • bun test storage.test.ts - pass (regression)

Summary by cubic

Follow-up fixes for Atlas task session reuse. Broadened session ID parsing, hardened task session storage, and removed unsafe casts; added comprehensive tests for the top-level task parser.

  • Bug Fixes
    • Accept hyphenated session IDs in extractSessionIdFromOutput (regex ses_[a-zA-Z0-9_-]+).
    • Guard upsertTaskSessionState against __proto__, prototype, and constructor keys to prevent prototype pollution.
    • Use typeof narrowing for agent and category metadata in tool-execute-after.ts to replace unsafe casts.

Written for commit 3c7e6a3. Summary will update on new commits.

@code-yeongyu code-yeongyu merged commit 826284f into dev Mar 18, 2026
@code-yeongyu code-yeongyu deleted the fix/atlas-task-session-review-followup branch March 18, 2026 09:50
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Addresses review findings with safe hardening: prototype pollution guards, safe type narrowing, and broadened regex for IDs. Includes 12 new unit tests for the parser.

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.

1 participant