Skip to content

test(agent): pin the sidepanel chat input - ChatInput (Closes #1506) - #1961

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1506-chat-input
Oct 14, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
zcode-mbp/tests-1506-chat-input

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Closes #1506

What changed

One new file: trios/agent-server/apps/agent/entrypoints/sidepanel/index/ChatInput.test.ts (the path the issue's Success Criteria names). The subject ChatInput.tsx is untouched.

The 1 exported symbol is exercised (1 it( block; 0 blocked). The component is a forwardRef with hooks, so the pins read a static render of it - measured, the render goes through with the tab-picker and voice seams left real (the picker stays closed, the voice state is handed in as a full VoiceInputState fixture). The pins read the placeholder contract for the state handed in: the chat mode asks about this page, the agent mode asks what it should do, and a transcribing voice state wins over both and disables the field.

Not pinned, and why (issue User Story 2): the typing flow - the tab-mention editing, the key handling, the imperative handle, the submit and stop wiring - they live in handlers and effects that need a live document and window. The port env seam is seeded before any import can reach the env module (its one-time snapshot - the trap the agent-outputs suite documented), with the subject imported dynamically for that reason.

How it was verified (FR-004)

  • Passing run against the unmodified subject: 1 pass / 0 fail / 5 expect() calls, Ran 1 test across 1 file.
  • Deliberately broken copy (the chat-mode placeholder changed, valid syntax): 0 pass / 1 fail / 1 expect() calls. The subject was restored byte-identical (git checkout; git diff --name-only prints nothing) and the suite passes again.
  • No network, database or container; no existing test modified or weakened. The file is biome-check clean. The local typecheck reports 19 errors - the pre-existing base of this tree - and 0 mentions of the new file. Verified in-process: the full agent group passes this file next to every suite of this wave (252 pass / 3 fail, the 3 pre-existing local-only env failures, green in CI).
  • Local reproducibility note (issue bun test cannot resolve @/ aliases once .wxt/tsconfig.json exists (wxt prepare output breaks the bun 1.3.6 runtime resolver)Β #1909): bun run typecheck runs wxt prepare, whose generated .wxt/tsconfig.json makes bun 1.3.6 stop resolving @/ aliases for test runs until that generated directory is removed. CI's Tests jobs never run wxt prepare; every run quoted above is from a checkout without .wxt/.

Not verified

  • Nothing beyond the quoted local runs; the CI Tests / agent job re-runs the suite on this SHA.

Dmitrii Fedorov (@dmitrii-f-t27)

@tri-claw

tri-claw Bot commented Oct 14, 2026

Copy link
Copy Markdown

Summary by t27-bees

This PR adds a pinning test for the ChatInput component that verifies its placeholder text contracts across chat/agent modes and voice transcribing state. The test uses static server-side rendering with mocked storage and a pre-seeded environment variable to avoid the env module's one-time snapshot.

Worth a look

  • trios/agent-server/apps/agent/entrypoints/sidepanel/index/ChatInput.test.ts:28 β€” The module-level values Map is shared across all tests in the file. If more it blocks are added later, they will leak storage state into each other unless the map is cleared in a beforeEach.
  • trios/agent-server/apps/agent/entrypoints/sidepanel/index/ChatInput.test.ts:31-42 β€” The defineItem mock extracts fallback via (opts as { fallback?: unknown } | undefined)?.fallback. If opts is ever passed as a non-object (e.g., undefined or a primitive), this returns undefined rather than the intended fallback, which could mask misconfigured storage items.
  • trios/agent-server/apps/agent/entrypoints/sidepanel/index/ChatInput.test.ts:44 β€” The dynamic await import('./ChatInput') runs after the mocks are installed, which is correct for the env snapshot issue described. However, if the component's import graph reaches the env module before the mocks are evaluated (e.g., via a side-effect in a transitive dependency), the snapshot could still freeze. The current test passes, so this is a structural risk rather than an observed failure.

Read: 1 files, +101 -0, the whole diff. Head 9522422. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator Author

Tests / server-tools failed on the first CI run - the known ACL flake of #1901. Rerunning the failed job once per the wave's flake protocol; outcome recorded here.

Dmitrii Fedorov (@dmitrii-f-t27)

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

βœ… Tests passed β€” 3627/3697

Suite Passed Failed Skipped
βœ… agent 255/255 0 0
βœ… build 9/9 0 0
βœ… cdp-protocol 5/5 0 0
βœ… eval 93/93 0 0
βœ… server-agent 280/280 0 0
βœ… server-api 2159/2228 0 69
βœ… server-browser 6/6 0 0
βœ… server-integration 10/11 0 1
βœ… server-lib 279/279 0 0
βœ… server-pglive 166/166 0 0
βœ… server-root 68/68 0 0
βœ… server-sim 8/8 0 0
βœ… server-skills 31/31 0 0
βœ… server-tools 244/244 0 0
βœ… shared 14/14 0 0

View workflow run

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator Author

The Tests / server-tools flake (#1901) passed on the rerun - the run completed success. CI gates on this SHA:

  • Tests / agent: pass β€” the chat-input pin runs in the agent group.
  • All other Tests/ matrix jobs pass* (server-tools after one flake rerun, recorded above; server-pglive green on the first run).
  • Typecheck job: 19 errors = the known base count; 0 mentions of ChatInput.test.ts in the job log.
  • Biome job: red from base findings; 0 mentions of ChatInput.test.ts in the job log.

Dmitrii Fedorov (@dmitrii-f-t27)

@dmitrii-f-t27
dmitrii-f-t27 merged commit e3f133f into queen Oct 14, 2026
32 of 35 checks passed
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