Skip to content

Commit 8a76d79

Browse files
authored
fix(test): wait for the title hit in the search route test (#367)
## Related Issue No public issue. This is maintainer work for session safety, workspace trust, and terminal controls. ## Problem A very large session transcript can crash the local server. A fork drops the source title kind. File tools and git can follow a symlink out of the workspace. Project-local config can apply before the workspace is trusted. The terminal has no setting for the fullscreen layout, no click-to-toggle fold, and no jump-to-bottom control. ## What changed ```text open large transcript - push every parsed record in one call + append records one by one fork session - default title kind is replaceable + default title kind comes from the source write or git path - use the path as given + resolve the real path and reject a target outside the workspace project-local config - apply on load + apply only after the workspace is trusted terminal + tui_mode regular | fullscreen + click one fold to toggle it + jump to bottom when scrolled up ``` Also in this change: - `auto_session_title` can turn automatic titles off. - `PYTHINKER_CODE_REPEAT_BREAKER=0` turns off the repeated-tool-call stop. - MCP sign-in asks for offline access only when the server advertises it. - The browser extension skill resends a failed command as a file and can move the daemon off a busy port. - A failed telemetry flush no longer blocks exit. Telemetry hosts are unchanged. - Tower reviews name the next step after a verdict. - Dynamic workflow members are restored from persisted lifecycle events. Hosted banner targeting and login-region relay selection are not in this change. ## Evidence - **Before:** a cold read of a large wire file used a spread push that can overflow the stack. **After:** package `tsc` is clean for agent-core-v2, agent-gateway, transcript, oauth, telemetry, and the CLI. Focused tests: 141 passed (fold, MCP OAuth, repeat breaker, git hardening, real path). Write-tool tests passed. Tower identity fallback passed after the test forces `user.useConfigOnly`. - Full `pnpm test`, `pnpm lint`, `pnpm build`, and `nix build` were not run on this branch. ## Merge Danger **Door:** two-way Revert the branch. No published version or identity field changes. **Blast Radius:** session Workspace trust, file tools, git calls, session fork titles, and the terminal layout are the user-visible surfaces. A wrong trust gate can hide project-local config until the user trusts the folder. ## Checklist - [ ] I have read the [CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md) document. - [ ] I have linked a related issue (external PRs: the issue must have a maintainer's `/approve`). Internal maintainer change; no public issue. - [x] I have added tests that prove my feature works. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [ ] Ran `gen-docs` skill, or this PR needs no doc update. Config and env docs were updated in the same change. The `gen-docs` skill was not run as a separate pass. [skip changeset] <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Automated checks now verify that search results include the expected user, assistant, and title content before completing. This improves coverage of search-result completeness and helps identify cases where results are present but missing expected content. No user-facing functionality changed. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 9dbdc69 commit 8a76d79

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/agent-gateway/test/search/searchRoute.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ describe('server-v2 /api/v1/search', () => {
146146
for (let attempt = 0; attempt < 100; attempt++) {
147147
body = await postSearch({ query: '\u82F9\u679C' });
148148
expect(body.code).toBe(0);
149-
if (body.data.items.length > 0) break;
149+
const roles = new Set(body.data.items.map((h) => h.role));
150+
if (roles.has('user') && roles.has('assistant') && roles.has('title')) break;
150151
await new Promise((resolve) => setTimeout(resolve, 100));
151152
}
152153
expect(body).toBeDefined();

0 commit comments

Comments
 (0)