Repository navigation
fix(tui): 畸形读取响应返回稳定错误而不是崩溃(#82 切片) - #149
Merged
Merged
Conversation
…crashing A server or proxy that breaks the read contract (non-object data, non-list items, non-object items, non-string cursor, missing profile path or item identifiers) previously raised inside the command loop and ended the TUI. Report invalid_read_response, clear the selectable page, keep explicit retry, and never dereference entries without a readable identifier. Refs #82. Co-authored-by: Cursor <cursoragent@cursor.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
概要
这是 #82 中 TUI「字段/错误恢复」验收的一个切片,不关闭 #82。
此前如果服务端或代理违反读取契约,TUI 的命令循环会直接抛出 AttributeError/KeyError,导致整个 TUI 退出。触发情形包括:
data不是对象、items不是列表、条目不是对象、cursor不是字符串、Files 的 profile 缺少绝对path、Notes/Todos 条目缺少name。本 PR 的处理:
invalid_read_response,清空可选的旧页面,仍然只能通过显式retry重新走签名读取;ref不是对象、id 不是字符串)时,只提示「该条目没有可读取的标识。」,不会用None发起读取;MappingProxyType/tuple)仍然按合法页面处理。没有新增任何写入、ACK、后台轮询或权限;TUI 仍然只读。
仍未完成(#82 保持开放)
测试
src/msg/tui.py、tests/test_tui_transport_boundaries.py。python -m pytest tests/test_tui.py tests/test_tui_recovery.py tests/test_tui_transport_boundaries.py:54 passed,含两项真实 PG 的只读/撤权回归。Made with Cursor