Skip to content

fix: clear remaining test failures + content-less query tab regression#1116

Merged
datlechin merged 3 commits intomainfrom
fix/test-suite-leftovers
May 8, 2026
Merged

fix: clear remaining test failures + content-less query tab regression#1116
datlechin merged 3 commits intomainfrom
fix/test-suite-leftovers

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

Three loose ends from the AI audit work, two test-only and one real production fix.

What changed

test(ai-chat): resolve currentQuery via resolveTurnForWire instead of asserting on raw turn (b5bdac41)

AIChatViewModelMentionsTests.currentQueryResolved was asserting on userTurn.plainText directly after sendMessage(). The design intentionally keeps .attachment blocks raw until resolveTurnForWire runs (sibling tests Stored user turn keeps typed text raw and resolveTurnForWire expands attachments both pass and confirm this contract). Updated the test to call await vm.resolveTurnForWire(userTurn) first and assert on the wire-resolved text. Test-only change.

test(coordinator): seed lazy-load skip path with execution timestamp and registry eviction (0e2b0aec)

MainContentCoordinatorLazyLoadTests.skipsWhenAlreadyExecuting was missing setup that mirrors a real "tab is currently executing" state: rows seeded, lastExecutedAt set, registry evicted. Without those, the coordinator would compute needsLazyLoad = true for an unrelated reason, so the assertion was racing the actual early-return. Added the missing fixture state. Test-only change.

fix(session): do not auto-create empty query tab for content-less query payloads (59ac47bf)

SessionStateFactory.create was unconditionally calling tabMgr.addTab(...) on .query payloads. When the payload had nil initialQuery, nil tabTitle, and nil sourceFileURL (the "connection-only" case), users got an empty Query 1 tab they didn't ask for. Added a hasContent guard so empty .query payloads result in an empty tab manager, matching the existing .connectionOnlyPayload_createsEmptyTabManager test expectation. User-visible: opening a connection without an explicit tab payload no longer pre-populates an empty query tab.

Test plan

  • xcodebuild build green
  • swiftlint lint --strict clean on every touched file
  • All three previously failing tests now pass
  • No regressions in the broader test sweep (AIChatViewModelMentionsTests, MainContentCoordinatorLazyLoadTests, SessionStateFactoryTests, OpenTableTabTests)
  • Manual: open a connection from Welcome screen, confirm a fresh Query 1 tab still appears (the isNewTab=true path is unchanged)
  • Manual: restore a session that has no persisted tabs, confirm no empty Query 1 tab is created

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin datlechin merged commit d05c7da into main May 8, 2026
2 checks passed
@datlechin datlechin deleted the fix/test-suite-leftovers branch May 8, 2026 07:14
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