{"agent":"claude","input":"Give this app one consistent way to handle failed TanStack Query requests. Read the QueryClient setup and default options, the API client and its interceptors, every query and mutation hook, the components that render them, every error boundary and the route loaders first. Install dependencies, create .env from .env.example, and record the type check, lint and test results before changing anything. For each query, write down what the user sees today when the request fails on first load and when a refetch fails with data already on screen; include any error boundary that can never render. Add a failing test for the worst case first, using the existing MSW server to answer 500. Then: make queries with no data throw to the nearest error boundary through a throwOnError function in the default options; report a failed background refetch once, from a QueryCache onError, while keeping the stale data visible; report failed mutations from a MutationCache onError; remove error notifications from the HTTP interceptor but keep its 401 redirect; wrap the boundaries so a retry control refetches. In route loaders, keep rejecting for the data a page cannot render without, and prefetch secondary data without rejecting so its own boundary handles the failure. Replace retry: false with a function that retries network errors and 5xx responses twice and never a 4xx, with retries off in tests. Register the HTTP client's error type as the default error type. Do not add a dependency and do not change the notification component. Add tests for first-load failure, background refetch failure and a failed mutation. Open a pull request with a table of every query and its behaviour before and after, and the type check, lint and test output.","resources":[{"url":"https://github.com/your-org/your-app"}]}