-
Notifications
You must be signed in to change notification settings - Fork 101
LCORE-1673: e2e feature file for conversation compaction (no step implementation) #2611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Lightspeed Core Service (LCS) | ||
| service: | ||
| host: 0.0.0.0 | ||
| port: 8080 | ||
| auth_enabled: false | ||
| workers: 1 | ||
| color_log: true | ||
| access_log: true | ||
| ogx: | ||
| # Library mode - embeds OGX as library | ||
| use_as_library_client: true | ||
| # Unified mode: run.yaml (materialized per provider by CI/the harness) | ||
| # is consumed as the synthesis profile instead of the legacy two-file path. | ||
| config: | ||
| profile: run.yaml | ||
| user_data_collection: | ||
| feedback_enabled: true | ||
| feedback_storage: "/tmp/data/feedback" | ||
| transcripts_enabled: true | ||
| transcripts_storage: "/tmp/data/transcripts" | ||
| authentication: | ||
| module: "noop" | ||
| inference: | ||
| default_provider: openai | ||
| default_model: gpt-4o-mini | ||
| # Compaction e2e (LCORE-1673): a deliberately small window for the CI | ||
| # model so a three-turn conversation crosses the trigger threshold. | ||
| # The real model window is far larger; this only drives the local | ||
| # estimate, never the provider. | ||
| context_windows: | ||
| openai/gpt-4o-mini: 2000 | ||
| rag: | ||
| byok: | ||
| stores: | ||
| - rag_id: e2e-test-docs | ||
| backend: faiss | ||
| embedding_model: sentence-transformers/all-mpnet-base-v2 | ||
| embedding_dimension: 768 | ||
| vector_db_id: ${env.FAISS_VECTOR_STORE_ID} | ||
| db_path: ${env.KV_RAG_PATH:=~/.llama/storage/rag/kv_store.db} | ||
| score_multiplier: 1.0 | ||
| retrieval: | ||
| tool: | ||
| sources: | ||
| - e2e-test-docs | ||
|
|
||
| shields: | ||
| - name: pii-redaction | ||
| provider_id: redaction | ||
| config: | ||
| rules: | ||
| - pattern: '\d+' | ||
| replacement: '[NUM]' | ||
|
|
||
| # Same small window and threshold as lightspeed-stack-compaction.yaml, but | ||
| # compaction switched off: context_status must stay "full" past the | ||
| # threshold (enabled is a full off-switch). | ||
| compaction: | ||
| enabled: false | ||
| threshold_ratio: 0.1 | ||
| token_floor: 100 | ||
| buffer_turns: 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: Lightspeed Core Service (LCS) | ||
| service: | ||
| host: 0.0.0.0 | ||
| port: 8080 | ||
| auth_enabled: false | ||
| workers: 1 | ||
| color_log: true | ||
| access_log: true | ||
| ogx: | ||
| # Library mode - embeds OGX as library | ||
| use_as_library_client: true | ||
| # Unified mode: run.yaml (materialized per provider by CI/the harness) | ||
| # is consumed as the synthesis profile instead of the legacy two-file path. | ||
| config: | ||
| profile: run.yaml | ||
| user_data_collection: | ||
| feedback_enabled: true | ||
| feedback_storage: "/tmp/data/feedback" | ||
| transcripts_enabled: true | ||
| transcripts_storage: "/tmp/data/transcripts" | ||
| authentication: | ||
| module: "noop" | ||
| inference: | ||
| default_provider: openai | ||
| default_model: gpt-4o-mini | ||
| # Compaction e2e (LCORE-1673): a deliberately small window for the CI | ||
| # model so a three-turn conversation crosses the trigger threshold. | ||
| # The real model window is far larger; this only drives the local | ||
| # estimate, never the provider. | ||
| context_windows: | ||
| openai/gpt-4o-mini: 2000 | ||
| rag: | ||
| byok: | ||
| stores: | ||
| - rag_id: e2e-test-docs | ||
| backend: faiss | ||
| embedding_model: sentence-transformers/all-mpnet-base-v2 | ||
| embedding_dimension: 768 | ||
| vector_db_id: ${env.FAISS_VECTOR_STORE_ID} | ||
| db_path: ${env.KV_RAG_PATH:=~/.llama/storage/rag/kv_store.db} | ||
| score_multiplier: 1.0 | ||
| retrieval: | ||
| tool: | ||
| sources: | ||
| - e2e-test-docs | ||
|
|
||
| shields: | ||
| - name: pii-redaction | ||
| provider_id: redaction | ||
| config: | ||
| rules: | ||
| - pattern: '\d+' | ||
| replacement: '[NUM]' | ||
|
|
||
| # Compaction on with a low threshold: 10% of the 2000-token window, | ||
| # above a 100-token floor, keeping one recent turn verbatim. | ||
| compaction: | ||
| enabled: true | ||
| threshold_ratio: 0.1 | ||
| token_floor: 100 | ||
| buffer_turns: 1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: Lightspeed Core Service (LCS) | ||
| service: | ||
| host: 0.0.0.0 | ||
| port: 8080 | ||
| auth_enabled: false | ||
| workers: 1 | ||
| color_log: true | ||
| access_log: true | ||
| ogx: | ||
| # Server mode - connects to separate OGX service | ||
| use_as_library_client: false | ||
| url: http://${env.E2E_LLAMA_HOSTNAME}:8321 | ||
| api_key: xyzzy | ||
| user_data_collection: | ||
| feedback_enabled: true | ||
| feedback_storage: "/tmp/data/feedback" | ||
| transcripts_enabled: true | ||
| transcripts_storage: "/tmp/data/transcripts" | ||
| authentication: | ||
| module: "noop" | ||
| inference: | ||
| default_provider: openai | ||
| default_model: gpt-4o-mini | ||
| # Compaction e2e (LCORE-1673): a deliberately small window for the CI | ||
| # model so a three-turn conversation crosses the trigger threshold. | ||
| # The real model window is far larger; this only drives the local | ||
| # estimate, never the provider. | ||
| context_windows: | ||
| openai/gpt-4o-mini: 2000 | ||
| rag: | ||
| byok: | ||
| stores: | ||
| - rag_id: e2e-test-docs | ||
| backend: faiss | ||
| embedding_model: sentence-transformers/all-mpnet-base-v2 | ||
| embedding_dimension: 768 | ||
| vector_db_id: ${env.FAISS_VECTOR_STORE_ID} | ||
| db_path: ${env.KV_RAG_PATH:=~/.llama/storage/rag/kv_store.db} | ||
| score_multiplier: 1.0 | ||
| retrieval: | ||
| tool: | ||
| sources: | ||
| - e2e-test-docs | ||
|
|
||
| shields: | ||
| - name: pii-redaction | ||
| provider_id: redaction | ||
| config: | ||
| rules: | ||
| - pattern: '\d+' | ||
| replacement: '[NUM]' | ||
|
|
||
| # Same small window and threshold as lightspeed-stack-compaction.yaml, but | ||
| # compaction switched off: context_status must stay "full" past the | ||
| # threshold (enabled is a full off-switch). | ||
| compaction: | ||
| enabled: false | ||
| threshold_ratio: 0.1 | ||
| token_floor: 100 | ||
| buffer_turns: 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Lightspeed Core Service (LCS) | ||
| service: | ||
| host: 0.0.0.0 | ||
| port: 8080 | ||
| auth_enabled: false | ||
| workers: 1 | ||
| color_log: true | ||
| access_log: true | ||
| ogx: | ||
| # Server mode - connects to separate OGX service | ||
| use_as_library_client: false | ||
| url: http://${env.E2E_LLAMA_HOSTNAME}:8321 | ||
| api_key: xyzzy | ||
|
Comment on lines
+12
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- fixture files ---'
cat -n tests/e2e/configuration/server-mode/lightspeed-stack-compaction.yaml
cat -n tests/e2e/configuration/server-mode/lightspeed-stack-compaction-disabled.yaml
printf '%s\n' '--- OGX references ---'
rg -n -S --glob '!dist' --glob '!build' 'ogx|api_key|E2E_LLAMA_HOSTNAME' . | head -240Repository: lightspeed-core/lightspeed-stack Length of output: 25529 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- client construction ---'
sed -n '125,170p' src/client/ogx.py
printf '%s\n' '--- E2E topology and OGX service ---'
sed -n '70,130p' docker-compose.yaml
rg -n -S 'server-mode|lightspeed-stack-compaction|8321|E2E_LLAMA_HOSTNAME|network|tls|https' tests docker-compose.yaml Makefile docs/testing deploy scripts | head -240
printf '%s\n' '--- config model and URL validation ---'
rg -n -S 'class OgxConfiguration|api_key|base_url|url.*http|https.*url|AsyncOgxClient' src | head -220Repository: lightspeed-core/lightspeed-stack Length of output: 50388 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- OGX configuration model ---'
sed -n '835,880p' src/models/config.py
printf '%s\n' '--- compose exposure and networks ---'
sed -n '1,25p' docker-compose.yaml
sed -n '185,205p' docker-compose.yaml
printf '%s\n' '--- client tests ---'
sed -n '1,110p' tests/unit/client/test_ogx.py
printf '%s\n' '--- local dependency/cache source if present ---'
find . -path '*ogx_client*' -o -path '*ogx-client*' | head -80Repository: lightspeed-core/lightspeed-stack Length of output: 6514 🌐 Web query:
💡 Result: In the ogx-client Python SDK (which includes the AsyncOgxClient), providing an API key automatically configures the client to use the Authorization: Bearer authentication header [1][2]. You can provide the API key in two primary ways: 1. Constructor Argument: Pass the api_key parameter directly when initializing the client: from ogx_client import AsyncOgxClient client = AsyncOgxClient(api_key="your_api_key_here") 2. Environment Variable: Set the OGX_CLIENT_API_KEY environment variable. The SDK automatically detects this variable, which is recommended to avoid hardcoding keys in your source code [1][3][4]. Behavioral Notes: - Precedence: If both a constructor argument and the environment variable are provided, the constructor argument takes precedence [1][2]. - Header Details: When an API key is present, the SDK sets the Authorization: Bearer <api_key> header. This automatically derived header takes precedence over any Authorization header manually included in default_headers or custom headers [2]. - Manual Header Configuration: If you need to use a different authentication scheme or custom header, you can explicitly set it using the header_name and header_value parameters during initialization (e.g., header_name="Authorization", header_value="Bearer YOUR_TOKEN") [1][5]. Citations:
Sensitive Data Exposure (CWE-319): Cleartext Transmission of Sensitive Information Reachability: Internal · Exploitability: Moderate Use HTTPS for the OGX service URL when
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| user_data_collection: | ||
| feedback_enabled: true | ||
| feedback_storage: "/tmp/data/feedback" | ||
| transcripts_enabled: true | ||
| transcripts_storage: "/tmp/data/transcripts" | ||
| authentication: | ||
| module: "noop" | ||
| inference: | ||
| default_provider: openai | ||
| default_model: gpt-4o-mini | ||
| # Compaction e2e (LCORE-1673): a deliberately small window for the CI | ||
| # model so a three-turn conversation crosses the trigger threshold. | ||
| # The real model window is far larger; this only drives the local | ||
| # estimate, never the provider. | ||
| context_windows: | ||
| openai/gpt-4o-mini: 2000 | ||
| rag: | ||
| byok: | ||
| stores: | ||
| - rag_id: e2e-test-docs | ||
| backend: faiss | ||
| embedding_model: sentence-transformers/all-mpnet-base-v2 | ||
| embedding_dimension: 768 | ||
| vector_db_id: ${env.FAISS_VECTOR_STORE_ID} | ||
| db_path: ${env.KV_RAG_PATH:=~/.llama/storage/rag/kv_store.db} | ||
| score_multiplier: 1.0 | ||
| retrieval: | ||
| tool: | ||
| sources: | ||
| - e2e-test-docs | ||
|
|
||
| shields: | ||
| - name: pii-redaction | ||
| provider_id: redaction | ||
| config: | ||
| rules: | ||
| - pattern: '\d+' | ||
| replacement: '[NUM]' | ||
|
|
||
| # Compaction on with a low threshold: 10% of the 2000-token window, | ||
| # above a 100-token floor, keeping one recent turn verbatim. | ||
| compaction: | ||
| enabled: true | ||
| threshold_ratio: 0.1 | ||
| token_floor: 100 | ||
| buffer_turns: 1 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 28909
🤖 get_repo_knowledge executed:
get_repo_knowledge lightspeed-core/lightspeed-stack /tmp/coderabbit-repo-knowledge/lightspeed-core-lightspeed-stack-d57c5c34/learnings /tmp/coderabbit-repo-knowledge/lightspeed-core-lightspeed-stack-d57c5c34/conventionsLength of output: 21530
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 43927
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 5498
Authorization Bypass (CWE-306): Missing Authentication for Critical Function
Reachability: External · Exploitability: Moderate
Restrict the E2E service exposure. The four fixtures disable authentication and use the
noopmodule. Their Compose files publish8080:8080without a host-interface restriction, so a network peer that reaches the runner can send unauthenticated API requests. Change the mappings to127.0.0.1:8080:8080or enable test authentication.📍 Affects 4 files
tests/e2e/configuration/library-mode/lightspeed-stack-compaction.yaml#L3-L5(this comment)tests/e2e/configuration/server-mode/lightspeed-stack-compaction.yaml#L3-L5tests/e2e/configuration/library-mode/lightspeed-stack-compaction-disabled.yaml#L3-L5tests/e2e/configuration/server-mode/lightspeed-stack-compaction-disabled.yaml#L3-L5🤖 Prompt for AI Agents
Source: Coding guidelines