fix: summarize stringified terminal commands#10
Merged
Conversation
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.
变更原因
Case Z5 复测中
reasoning_summary已经通过,但Diagnostic checks completed.detail.checks[].commandSummary仍全部是泛化的Run terminal command with。定位后发现 Runtime Manager 收到的 terminal tool arguments 在实际链路里可能是字符串化的{command: ...}/ JSON-like 形式,旧逻辑没有先解析command字段,直接把整段字符串当作 shell 命令摘要,导致摘要变成Run terminal command with {command:,Cloud 再脱敏后只剩泛化文本。解决方法
{command: ...}/{cmd: ...}/{shell_command: ...}字符串。_safe_command_summary,生成kubectl get/describe/logs/exec等安全概述。KUBECONFIG=.../export KUBECONFIG=... &&等前置环境变量赋值,避免把运行上下文混进用户可见命令概述。验证
uv run --extra dev pytest tests/runtime_manager/test_registry.py -k 'tool_event_helpers_are_json_safe or summarizes_stringified_terminal_arguments' -q\n-uv run --extra dev pytest tests/runtime_manager -q\n-uv run ruff check runtime_manager tests/runtime_manager\n-git diff --check\n-git diff --check origin/apecloud-base...HEAD\n