From 4135a6cee58ad26f9791da614037362d38ca371b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Fri, 9 Jan 2026 16:43:00 +0100 Subject: [PATCH] ci: frozen uv sync (#138) * ci: frozen uv sync * fix: add missing authorization parameter to get_agent_stats in CLI The generated Rust client was updated with an authorization header parameter for get_agent_stats, but the CLI code wasn't updated. --- .github/workflows/test.yml | 30 +++++++++---------- hindsight-cli/src/api.rs | 2 +- .../hindsight_client_api/api/banks_api.py | 15 ++++++++++ .../generated/core/serverSentEvents.gen.ts | 2 -- .../typescript/generated/types.gen.ts | 6 ++++ hindsight-docs/static/openapi.json | 16 ++++++++++ 6 files changed, 53 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e084b006..7ce3e7fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -222,7 +222,7 @@ jobs: - name: Install API dependencies working-directory: ./hindsight-api - run: uv sync --no-install-project --index-strategy unsafe-best-match + run: uv sync --frozen --no-install-project --index-strategy unsafe-best-match - name: Create .env file run: | @@ -352,7 +352,7 @@ jobs: - name: Install dependencies working-directory: ./hindsight-api - run: uv sync --extra test --no-install-project --index-strategy unsafe-best-match + run: uv sync --frozen --extra test --no-install-project --index-strategy unsafe-best-match - name: Cache HuggingFace models uses: actions/cache@v4 @@ -413,11 +413,11 @@ jobs: - name: Install client test dependencies working-directory: ./hindsight-clients/python - run: uv sync --extra test --index-strategy unsafe-best-match + run: uv sync --frozen --extra test --index-strategy unsafe-best-match - name: Install API dependencies working-directory: ./hindsight-api - run: uv sync --no-install-project --index-strategy unsafe-best-match + run: uv sync --frozen --no-install-project --index-strategy unsafe-best-match - name: Create .env file run: | @@ -490,7 +490,7 @@ jobs: - name: Install API dependencies working-directory: ./hindsight-api - run: uv sync --no-install-project --index-strategy unsafe-best-match + run: uv sync --frozen --no-install-project --index-strategy unsafe-best-match - name: Install TypeScript client dependencies working-directory: ./hindsight-clients/typescript @@ -578,7 +578,7 @@ jobs: - name: Install API dependencies working-directory: ./hindsight-api - run: uv sync --no-install-project --index-strategy unsafe-best-match + run: uv sync --frozen --no-install-project --index-strategy unsafe-best-match - name: Create .env file run: | @@ -645,11 +645,11 @@ jobs: - name: Install API dependencies working-directory: ./hindsight-api - run: uv sync --no-install-project --index-strategy unsafe-best-match + run: uv sync --frozen --no-install-project --index-strategy unsafe-best-match - name: Install integration test dependencies working-directory: ./hindsight-integration-tests - run: uv sync + run: uv sync --frozen - name: Cache HuggingFace models uses: actions/cache@v4 @@ -729,7 +729,7 @@ jobs: - name: Install dependencies working-directory: ./hindsight-integrations/litellm - run: uv sync --extra dev + run: uv sync --frozen --extra dev - name: Run tests working-directory: ./hindsight-integrations/litellm @@ -760,7 +760,7 @@ jobs: - name: Install dependencies working-directory: ./hindsight-embed - run: uv sync --index-strategy unsafe-best-match + run: uv sync --frozen --index-strategy unsafe-best-match - name: Cache HuggingFace models uses: actions/cache@v4 @@ -820,11 +820,11 @@ jobs: working-directory: ./hindsight-api run: | uv build - uv sync --no-install-project --index-strategy unsafe-best-match + uv sync --frozen --no-install-project --index-strategy unsafe-best-match - name: Install Python client dependencies working-directory: ./hindsight-clients/python - run: uv sync --extra test --index-strategy unsafe-best-match + run: uv sync --frozen --extra test --index-strategy unsafe-best-match - name: Install TypeScript client run: | @@ -928,9 +928,9 @@ jobs: - name: Install Python dependencies run: | - cd hindsight-dev && uv sync --index-strategy unsafe-best-match - cd ../hindsight-api && uv sync --index-strategy unsafe-best-match - cd ../hindsight-embed && uv sync --index-strategy unsafe-best-match + cd hindsight-dev && uv sync --frozen --index-strategy unsafe-best-match + cd ../hindsight-api && uv sync --frozen --index-strategy unsafe-best-match + cd ../hindsight-embed && uv sync --frozen --index-strategy unsafe-best-match - name: Run generate-openapi run: ./scripts/generate-openapi.sh diff --git a/hindsight-cli/src/api.rs b/hindsight-cli/src/api.rs index eb42e324..e928778d 100644 --- a/hindsight-cli/src/api.rs +++ b/hindsight-cli/src/api.rs @@ -103,7 +103,7 @@ impl ApiClient { pub fn get_stats(&self, agent_id: &str, _verbose: bool) -> Result { self.runtime.block_on(async { - let response = self.client.get_agent_stats(agent_id).await?; + let response = self.client.get_agent_stats(agent_id, None).await?; let value = response.into_inner(); // Convert to JSON Value first, then parse into our type let json_value = serde_json::to_value(&value)?; diff --git a/hindsight-clients/python/hindsight_client_api/api/banks_api.py b/hindsight-clients/python/hindsight_client_api/api/banks_api.py index fce5eaa4..30b7a14d 100644 --- a/hindsight-clients/python/hindsight_client_api/api/banks_api.py +++ b/hindsight-clients/python/hindsight_client_api/api/banks_api.py @@ -939,6 +939,7 @@ class BanksApi: async def get_agent_stats( self, bank_id: StrictStr, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -958,6 +959,8 @@ class BanksApi: :param bank_id: (required) :type bank_id: str + :param authorization: + :type authorization: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -982,6 +985,7 @@ class BanksApi: _param = self._get_agent_stats_serialize( bank_id=bank_id, + authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1007,6 +1011,7 @@ class BanksApi: async def get_agent_stats_with_http_info( self, bank_id: StrictStr, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1026,6 +1031,8 @@ class BanksApi: :param bank_id: (required) :type bank_id: str + :param authorization: + :type authorization: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1050,6 +1057,7 @@ class BanksApi: _param = self._get_agent_stats_serialize( bank_id=bank_id, + authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1075,6 +1083,7 @@ class BanksApi: async def get_agent_stats_without_preload_content( self, bank_id: StrictStr, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1094,6 +1103,8 @@ class BanksApi: :param bank_id: (required) :type bank_id: str + :param authorization: + :type authorization: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1118,6 +1129,7 @@ class BanksApi: _param = self._get_agent_stats_serialize( bank_id=bank_id, + authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1138,6 +1150,7 @@ class BanksApi: def _get_agent_stats_serialize( self, bank_id, + authorization, _request_auth, _content_type, _headers, @@ -1163,6 +1176,8 @@ class BanksApi: _path_params['bank_id'] = bank_id # process the query parameters # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter diff --git a/hindsight-clients/typescript/generated/core/serverSentEvents.gen.ts b/hindsight-clients/typescript/generated/core/serverSentEvents.gen.ts index 60f825c1..06ae8809 100644 --- a/hindsight-clients/typescript/generated/core/serverSentEvents.gen.ts +++ b/hindsight-clients/typescript/generated/core/serverSentEvents.gen.ts @@ -169,8 +169,6 @@ export const createSseClient = ({ const { done, value } = await reader.read(); if (done) break; buffer += value; - // Normalize line endings: CRLF -> LF, then CR -> LF - buffer = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n"); const chunks = buffer.split("\n\n"); buffer = chunks.pop() ?? ""; diff --git a/hindsight-clients/typescript/generated/types.gen.ts b/hindsight-clients/typescript/generated/types.gen.ts index 04468411..d3a2d3b9 100644 --- a/hindsight-clients/typescript/generated/types.gen.ts +++ b/hindsight-clients/typescript/generated/types.gen.ts @@ -1320,6 +1320,12 @@ export type ListBanksResponse = ListBanksResponses[keyof ListBanksResponses]; export type GetAgentStatsData = { body?: never; + headers?: { + /** + * Authorization + */ + authorization?: string | null; + }; path: { /** * Bank Id diff --git a/hindsight-docs/static/openapi.json b/hindsight-docs/static/openapi.json index 319d0768..d1cd6cbe 100644 --- a/hindsight-docs/static/openapi.json +++ b/hindsight-docs/static/openapi.json @@ -454,6 +454,22 @@ "type": "string", "title": "Bank Id" } + }, + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Authorization" + } } ], "responses": {