fix: convert dict to KernelSnapshot in kernel state endpoint#31
Merged
fix: convert dict to KernelSnapshot in kernel state endpoint#31
Conversation
The get_kernel_state method in ConversationalAgent returns a dict,
but _snapshot_to_response expected a KernelSnapshot object. Added
type checking and conversion logic to handle both cases.
Fixes: 500 error on GET /api/sessions/{id}/kernel
These directories contained outdated code that no longer works with the current codebase: - demo/financial-mcp: old MCP demo - examples/: old usage examples and run outputs
Adds GitHub Actions workflow with multiple security tools: - Bandit: Python code security analysis - pip-audit: Dependency vulnerability scanning - Gitleaks: Secret detection - Trivy: Docker container security scanning - OSSF Scorecard: Repository security best practices Results are uploaded to GitHub Security tab.
- Use --exit-zero for Bandit to ensure SARIF file is always created - Update all upload-sarif actions from v3 to v4 - Add file existence check before uploading SARIF files
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
- Update scikit-learn>=1.5.0 to fix CVE PYSEC-2024-110 (TfidfVectorizer data leakage) - Add --skip-editable to pip-audit to skip local package not yet on PyPI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
GET /api/sessions/{session_id}/kernelendpoint was returning a 500 Internal Server Error:Root Cause
The
get_kernel_state()method inConversationalAgentreturns aDict[str, Any], but the_snapshot_to_response()function expected aKernelSnapshotobject and tried to access.variablesas an attribute.Solution
Added type checking and conversion logic to handle both cases:
dictis returned, convert it to aKernelSnapshotobjectKernelSnapshotis already returned, use it directlyTesting