These tests exercise the dual-agent late-file regression: the inner sandbox agent settles startup quickly and calls Reload while `~/.mcp.json` still does not exist on disk. The host agent then writes the file ~20s later. Before this fix, the manager cached an empty snapshot and stayed empty until a
(ctx context.Context, t *testing.T, m *Manager, pred func([]workspacesdk.MCPToolInfo) bool)
| 35 | // awaitTools polls cachedTools until the predicate succeeds or |
| 36 | // the context expires. It avoids time.Sleep loops in callers. |
| 37 | func awaitTools(ctx context.Context, t *testing.T, m *Manager, pred func([]workspacesdk.MCPToolInfo) bool) []workspacesdk.MCPToolInfo { |
| 38 | t.Helper() |
| 39 | var final []workspacesdk.MCPToolInfo |
| 40 | testutil.Eventually(ctx, t, func(context.Context) bool { |
| 41 | final = m.cachedTools() |
| 42 | return pred(final) |
| 43 | }, testutil.IntervalFast) |
| 44 | return final |
| 45 | } |
| 46 | |
| 47 | // useFastDebounce shortens the watcher's debounce window so |
| 48 | // real-clock tests do not stall on the 250 ms default. Must be |
no test coverage detected