Repository navigation
feat(boot): Issue #70 — Step 3 Memory Restore を McpHealthCheck.psm1 でワイヤリング #81
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
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 | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,6 +39,7 @@ $ScriptRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) | |||||||||||||||||||||||||||||||||||||||
| Import-Module (Join-Path $ScriptRoot 'scripts\lib\LauncherCommon.psm1') -Force -DisableNameChecking | ||||||||||||||||||||||||||||||||||||||||
| Import-Module (Join-Path $ScriptRoot 'scripts\lib\Config.psm1') -Force | ||||||||||||||||||||||||||||||||||||||||
| Import-Module (Join-Path $ScriptRoot 'scripts\lib\AgentTeams.psm1') -Force | ||||||||||||||||||||||||||||||||||||||||
| Import-Module (Join-Path $ScriptRoot 'scripts\lib\McpHealthCheck.psm1') -Force | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| function Write-BootStep { | ||||||||||||||||||||||||||||||||||||||||
| param( | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -132,6 +133,60 @@ function Invoke-StepSystemInit { | |||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| function Invoke-StepMemoryRestore { | ||||||||||||||||||||||||||||||||||||||||
| param([string]$Root) | ||||||||||||||||||||||||||||||||||||||||
| Write-BootStep 3 'Memory Restore' | ||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||
| $report = Get-McpHealthReport -ProjectRoot $Root | ||||||||||||||||||||||||||||||||||||||||
| if (-not $report.configured) { | ||||||||||||||||||||||||||||||||||||||||
| Write-Host ' [SKIP] .mcp.json not found' -ForegroundColor DarkGray | ||||||||||||||||||||||||||||||||||||||||
| Write-Host '' | ||||||||||||||||||||||||||||||||||||||||
| return @{ Step = 3; Name = 'Memory Restore'; Status = 'SKIP'; Detail = 'no mcp config' } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| $memoryConn = @($report.connections | Where-Object { $_.kind -eq 'memory' }) | Select-Object -First 1 | ||||||||||||||||||||||||||||||||||||||||
| if (-not $memoryConn) { | ||||||||||||||||||||||||||||||||||||||||
| Write-Host ' [SKIP] memory server not configured in .mcp.json' -ForegroundColor DarkGray | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+141
to
+149
|
||||||||||||||||||||||||||||||||||||||||
| if (-not $report.configured) { | |
| Write-Host ' [SKIP] .mcp.json not found' -ForegroundColor DarkGray | |
| Write-Host '' | |
| return @{ Step = 3; Name = 'Memory Restore'; Status = 'SKIP'; Detail = 'no mcp config' } | |
| } | |
| $memoryConn = @($report.connections | Where-Object { $_.kind -eq 'memory' }) | Select-Object -First 1 | |
| if (-not $memoryConn) { | |
| Write-Host ' [SKIP] memory server not configured in .mcp.json' -ForegroundColor DarkGray | |
| $configLabel = if ($report.configPath) { $report.configPath } else { '.mcp.json' } | |
| if (-not $report.configured) { | |
| Write-Host (' [SKIP] {0} not found' -f $configLabel) -ForegroundColor DarkGray | |
| Write-Host '' | |
| return @{ Step = 3; Name = 'Memory Restore'; Status = 'SKIP'; Detail = 'no mcp config' } | |
| } | |
| $memoryConn = @($report.connections | Where-Object { $_.kind -eq 'memory' }) | Select-Object -First 1 | |
| if (-not $memoryConn) { | |
| Write-Host (' [SKIP] memory server not configured in {0}' -f $configLabel) -ForegroundColor DarkGray |
Copilot
AI
Apr 14, 2026
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.
Invoke-StepMemoryRestore returns Status='OK' as long as a memory server entry exists in .mcp.json, even if that server is unavailable/unhealthy (e.g., command missing on Linux, or runtime probe/health status indicates failure). This can lead to a misleading boot summary where Memory Restore reports OK when it cannot actually run. Consider basing the status on the selected memory server’s availability/health (e.g., skip or fail with a clear detail when unavailable) and include the connection/server status in the returned Detail for diagnostics.
Copilot
AI
Apr 14, 2026
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.
The memory file existence checks use Test-Path $filePath (twice) without -LiteralPath / -PathType Leaf. Using -LiteralPath avoids wildcard expansion, and PathType Leaf avoids treating a directory as a valid “memory file”; also consider computing a single $fileExists flag to avoid repeating Test-Path.
Copilot
AI
Apr 14, 2026
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.
PR description says that when CLAUDE_MEMORY_FILE_PATH is unset the output should show something like “configured (file not yet created)” as a normal case, but the implementation labels it “CLAUDE_MEMORY_FILE_PATH not set”. Please align the output behavior with the PR description (either adjust the message/logic or update the PR description).
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.
The script header comment still states that Step 3 is a placeholder that emits SKIP (it lists steps 3/5/6/7/8 as placeholders). Since Step 3 is now implemented via Invoke-StepMemoryRestore, please update the top-of-file description to avoid misleading users and future maintainers.