Skip to content

Chronicle: Surface agent_name, fix SQL truncation, and improve query reliability#311838

Merged
vijayupadya merged 2 commits intomainfrom
vijayu/chronicleUpdates
Apr 22, 2026
Merged

Chronicle: Surface agent_name, fix SQL truncation, and improve query reliability#311838
vijayupadya merged 2 commits intomainfrom
vijayu/chronicleUpdates

Conversation

@vijayupadya
Copy link
Copy Markdown
Contributor

Surface agent_name, fix SQL truncation, and improve query reliability

…reliability

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 22, 2026 04:40
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 70d194f9 Current: 794b223e

Changed (3)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
agentSessionsViewer/WithBadge/Dark
Before After
before after
agentSessionsViewer/WithBadge/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Copilot Chronicle session storage and querying so sessions can surface an agent_name, SQL query results are less aggressively truncated, and chronicle prompts/queries use more reliable session context.

Changes:

  • Add agent_name and agent_description fields to the Chronicle sessions schema and SessionRow typing; populate agent_name from OTel span attributes.
  • Increase chronicle query limits (to 100) and switch sessions queries to SELECT * to include the new columns.
  • Improve session_store_sql result formatting by using an adaptive per-cell truncation limit instead of a fixed 100 chars.
Show a summary per file
File Description
extensions/copilot/src/platform/chronicle/node/sessionStore.ts Bumps schema version and adds DB migration + upsert support for agent_name/agent_description.
extensions/copilot/src/platform/chronicle/common/sessionStore.ts Extends SessionRow interface with agent_name and agent_description.
extensions/copilot/src/extension/tools/node/sessionStoreSqlTool.ts Makes SQL output truncation adaptive using a global formatting budget.
extensions/copilot/src/extension/intents/node/chronicleIntent.ts Updates cloud sessions query/limits and schema description; plumbs agent fields from cloud rows.
extensions/copilot/src/extension/chronicle/vscode-node/sessionStoreTracker.ts Persists agent_name into the local session store during session initialization.
extensions/copilot/src/extension/chronicle/common/standupPrompt.ts Includes agent in standup session lines and uses first turn text as a fallback “summary”.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 2

Comment thread extensions/copilot/src/platform/chronicle/node/sessionStore.ts
Comment thread extensions/copilot/src/extension/tools/node/sessionStoreSqlTool.ts
Co-authored-by: Copilot <copilot@github.com>
@vijayupadya vijayupadya marked this pull request as ready for review April 22, 2026 05:18
@vijayupadya vijayupadya enabled auto-merge (squash) April 22, 2026 05:18
@vijayupadya vijayupadya merged commit f7e87a2 into main Apr 22, 2026
26 checks passed
@vijayupadya vijayupadya deleted the vijayu/chronicleUpdates branch April 22, 2026 06:43
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 22, 2026
@uditkotecha1-hub
Copy link
Copy Markdown

🕵️ CodeSherlock Review:

🔴 Critical Issues:

  • The change in the SQL queries from selecting specific columns to using SELECT * may lead to performance degradation and should be avoided without a good reason, especially when working with large datasets. This can result in retrieving unnecessary data and increase latency.

🟡 Improvements:

  • The handling of session summaries has been improved by using the first turn's user message as a fallback, which enhances the completeness of the prompt and the overall usability of the data.
  • The addition of the agent_name to the session structure increases the context of the sessions for better tracking and understanding.

🟢 Good Practices:

  • The implementation of default values (e.g., 'unknown' for branch and repository) when data is missing follows a good defensive programming strategy, improving robustness.
  • Clearly documented SQL query rules and guidelines within the comments ensure maintainability and understanding of the codebase.

💡 Suggestions:

  • Consider returning only the necessary columns in the SQL queries, as this is a common best practice for readability and performance.
  • If the increase in the LIMIT in the queries is essential, ensure that the corresponding logic to handle larger datasets is in place to avoid performance issues.
  • Add comments to clarify the importance of using JOIN between sessions and turns, especially in the context of employing session summaries.

Risk Level: MEDIUM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants