Skip to content

test: favor behavior over implementation details - #7157

Merged
juliusmarminge merged 2 commits into
mainfrom
test/prune-useless-tests-20260816-023611
Aug 16, 2026
Merged

test: favor behavior over implementation details#7157
juliusmarminge merged 2 commits into
mainfrom
test/prune-useless-tests-20260816-023611

Conversation

@t3-code

@t3-code t3-code Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

what changed

  • removed the unused mobile terminal subscription-key helper and its six implementation-detail tests
  • removed the test-only pending-launch peek method, keeping coverage through the production take behavior
  • removed a test that inspected a private MessagesTimeline class string, then made the class constant private
  • removed the test-only composer primary-action breakpoint alias and kept coverage on the public layout behavior
  • removed a duplicate literal assertion from the shared terminal id allocator test
  • dropped the overlapping mobile terminal test removal because PR test: remove redundant and stale tests #6267 already owns it

why

these tests and exports exposed private implementation details without adding unique regression signal. the remaining tests exercise pending-launch consumption, rendered timeline behavior, composer layout behavior at the actual breakpoint, and the terminal allocator's public result.

verification

  • focused tests: 5 files passed, 52 tests passed
  • web typecheck passed
  • mobile typecheck passed
  • targeted lint passed
  • targeted format passed
  • git diff --check passed

created by gpt-5.6-sol via hermes agent using openai-codex.

request provenance


Note

Low Risk
Test and API-surface cleanup only; no production logic changes beyond making one CSS constant non-exported and removing an unused peek helper.

Overview
Trims tests and exports that only locked in private helpers, without changing user-facing behavior.

Mobile terminal: Drops peekPendingTerminalLaunch and pending-launch tests now assert consume-once via repeated takePendingTerminalLaunch. Removes threadTerminalSubscriptionKey and deletes its dedicated test file; attach input building stays.

Web chat: Stops exporting toolCallExpandedBodyClassName from MessagesTimeline (module-local only) and removes the test that asserted on that class string.

Composer layout: Removes the COMPOSER_PRIMARY_ACTIONS_COMPACT_BREAKPOINT_PX alias; primary-action compactness still uses the wide footer breakpoint in tests and implementation.

Shared: Drops a redundant duplicate expectation in nextTerminalId tests.

Reviewed by Cursor Bugbot for commit f3359b9. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Remove internal implementation details from exported module APIs in tests

  • Removes peekPendingTerminalLaunch from terminalLaunchContext.ts and threadTerminalSubscriptionKey from threadTerminalPanelModel.ts; tests now only assert on observable behavior via takePendingTerminalLaunch.
  • Makes toolCallExpandedBodyClassName in MessagesTimeline.tsx and COMPOSER_PRIMARY_ACTIONS_COMPACT_BREAKPOINT_PX in composerFooterLayout.ts internal, removing their exports and corresponding test assertions.
  • Tests are updated to verify behavior through public-facing functions rather than inspecting internal constants or helper utilities.

Macroscope summarized f3359b9.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Aug 16, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 16, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved f3359b9

Test refactoring that removes implementation-detail tests and makes internal symbols private. No runtime behavior changes - purely removing redundant exports and test code.

You can customize Macroscope's approvability policy. Learn more.

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 12.6 KiB 12.6 KiB −11 B (−0.1%) 15.1 KiB
Codex Thread snapshot wire 6.3 KiB 6.3 KiB −10 B (−0.2%) 7.3 KiB
Codex Live turn WebSocket wire 6.3 KiB 6.3 KiB −1 B (−0.0%) 7.8 KiB
Codex Live turn WebSocket decoded 51.8 KiB 51.8 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 16 16 0 (0.0%) 21
Claude Total thread wire 12.6 KiB 12.6 KiB −19 B (−0.1%) 15.1 KiB
Claude Thread snapshot wire 6.3 KiB 6.3 KiB −4 B (−0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.3 KiB 6.3 KiB −15 B (−0.2%) 7.8 KiB
Claude Live turn WebSocket decoded 52.7 KiB 52.7 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 16 16 0 (0.0%) 21

Baseline: d484735 · PR result: f3359b9 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 99.9 KiB
  • Claude decoded thread snapshot: 100.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
@t3-code t3-code Bot changed the title test(mobile): remove duplicate terminal id tests test: favor behavior over implementation details Aug 16, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 16, 2026 03:18

Dismissing prior approval to re-evaluate f3359b9

@juliusmarminge
juliusmarminge merged commit 3583cd2 into main Aug 16, 2026
19 checks passed
@juliusmarminge
juliusmarminge deleted the test/prune-useless-tests-20260816-023611 branch August 16, 2026 08:06
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 16, 2026
## What's Changed
* test: favor behavior over implementation details by @t3-code[bot] in pingdotgg/t3code#7157
* feat(mobile): add built-in themes by @chrisdeeming in pingdotgg/t3code#6619
* docs: point CLAUDE.md at AGENTS.md with an @import instead of a symlink by @UtkarshUsername in pingdotgg/t3code#7171


**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260816.1106...v0.0.34-nightly.20260816.1108

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260816.1108
longtngo added a commit to longtngo/t3code that referenced this pull request Aug 16, 2026
Range: 20a7042..bab4b6f. 129 files, +4083/-2027. Nine files touched by
both sides; one conflict.

## Conflict: apps/web/src/components/chat/MessagesTimeline.tsx

A fork decision re-surfacing rather than merge work. The fork deliberately
does not carry upstream pingdotgg#4083's `workEntryRawCommand` /
`buildToolCallExpandedBody` -- it opens work-log detail in a modal, so both
helpers would be unused -- and kept `toolCallExpandedBodyClassName` exported
only because a test imported it.

Upstream pingdotgg#7157 has now deleted that test as an implementation-detail
assertion and made the const module-local. Resolution: keep the fork's side
(helpers still not carried), adopt upstream's un-export, and correct the
comment, whose "its tests import it" clause is now false.

Checked before resolving, since markers cannot show either: nothing else in
the tree imports the symbol, and no call sites for the two dropped helpers
auto-merged in elsewhere in the file.

## Invariants (re-probed against the merged tree, not recalled)

1. Migrations -- 44 entries, ids unique and monotonic, max 45, only gap 34
   (intentionally burned). No duplicate ids.
2. Fork-owned effect patch -- still pinned at @effect/platform-node@4.0.0-
   beta.103 with its FORK-ONLY comment; patch file present. No effect bump in
   this range, so no retirement is due.
3. Sidebar default -- AppSidebarLayout renders ThreadSidebar by default;
   LegacyThreadSidebar stays behind `legacySidebarEnabled`.
4. Deliberate deletions -- sweep clean (below).
5. Mid-turn send queues, does not steer -- no `it`/`it.effect` declaring a
   steering test, the FORK tombstone comment intact at ClaudeAdapter.test.ts:
   1095, and all three fork queue tests present (FIFO drain order, interrupt
   discards, model re-set).
6. Two project entry points -- "Two buttons, not one" intact in Sidebar.tsx.

Three first-pass probes were wrong and were fixed rather than counted: the
migration probe matched no ids at all (wrong regex; entries=0 reads exactly
like a passing tree), the invariant-5 grep matched the tombstone comment
rather than a real test, and `legacySidebarEnabled` sits at a different path
than the registry records.

## Sweeps

Resurrected 0, dropped 0, fork-loss 1 -- the single comment line reworded in
the conflict resolution above.

## Dependencies

Full `pnpm install` (not --lockfile-only); `pnpm-lock.yaml` unchanged, so the
committed lockfile is the one the gate verified. `packages/shared/package.json`
took both sides: the fork's `./localLlm` export and upstream's
`./themePalettes` / `./themePreview`.

Upstream pingdotgg#7171 converts CLAUDE.md from a symlink into a file containing
`@AGENTS.md`. Accepted -- the fork's "## This fork" section lives in
AGENTS.md and is untouched.

## Gate

pnpm install && pnpm run verify: 9,195 passed, 7 skipped, 0 failures.
Net -6 against the pre-merge 9,201, consistent with upstream pingdotgg#6267/pingdotgg#7157
removing stale tests (-20 in the web unit project) against its theme and
PR-line-request additions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant