Repository navigation
fix: fail on missing HOME, bound GitHub API waits, reject unknown hook keys - #218
Conversation
…k keys - fail install, verify and config sync when HOME is unset instead of using "." - set connect, response and body timeouts on the GitHub REST agent - reject unknown provider keys in hooks.json - keep the original fetch error when the status file is corrupt or unwritable - merge Codex TOML inline tables key by key instead of overwriting them Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
| match (target.as_table_mut(), source.as_table()) { | ||
| match (target.as_table_like_mut(), source.as_table_like()) { | ||
| (Some(target), Some(source)) => merge_tables(target, source), | ||
| _ => *target = source.clone(), |
There was a problem hiding this comment.
P2 — When the target is an inline table and the source has a standard sub-table under a key the target doesn't have yet, merge_tables calls entry(key).or_insert(Item::None) on the InlineTable. Then this fallback writes source.clone(), an Item::Table, into it. An inline table can only hold values. As far as I know, toml_edit's inline-table encoder only writes Item::Value entries and skips Item::Table, so the merged entries disappear from the output without any error.
Example: base config.toml has permissions = {} (or permissions = { other = 1 }). The protection fragment is [permissions.guarded.filesystem] (two implicit parent tables, then real keys). guarded gets inserted as an Item::Table inside the inline permissions, and the generated config loses every guarded read denial and glob_scan_max_depth. That silently drops a safety control. Before this change, as_table_mut didn't match an inline target, so the source table replaced it and the protections were kept. External [features.<sub>] tables merged into an inline features hit the same problem.
I couldn't run this in the review sandbox, so please confirm with a test such as permissions = {} merged with [permissions.guarded.filesystem]\n"/a" = "read". Possible fix: when the target is an InlineTable and the source item is an Item::Table, insert Item::Value(Value::InlineTable(table.clone().into_inline_table())). Alternatively, turn the target inline table into a standard table before merging.
Review summaryBlocking findings (P0/P1): 0
Other items I checked and found no problems with:
🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d4b92325a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| match (target.as_table_like_mut(), source.as_table_like()) { | ||
| (Some(target), Some(source)) => merge_tables(target, source), | ||
| _ => *target = source.clone(), |
There was a problem hiding this comment.
Convert nested tables before merging into inline tables
When the target contains an inline parent such as permissions = { ... } and the generated protection fragment contributes a previously absent nested table such as [permissions.guarded.filesystem], this branch clones an Item::Table directly into an InlineTable. toml_edit inline tables require value-form entries, so the resulting document cannot be serialized correctly and installation can fail or omit the generated filesystem protections. Convert nested tables to inline-table values or promote the target inline table before recursively merging.
Useful? React with 👍 / 👎.
| fn home_dir() -> Result<PathBuf> { | ||
| std::env::var_os("HOME") | ||
| .map(PathBuf::from) | ||
| .context("HOME is not set; pass --prefix or set HOME") |
There was a problem hiding this comment.
Do not suggest --prefix for sync commands
When HOME is unset during sync-config or any hidden sync-*-config alias, this shared helper tells the user to pass --prefix, but those commands only accept --source and --target; following the suggested remediation therefore produces a clap unknown-argument error. Use a context-specific message for sync commands or actually expose a supported override.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
レビュー対応(adb88c9):
🤖 Generated with Claude Code |
|
@codex review |
| target: &args.target, | ||
| }; | ||
| crate::config_sync::sync(provider.spec(), &paths, &default_home_dir()) | ||
| crate::config_sync::sync(provider.spec(), &paths, &home_dir()?) |
There was a problem hiding this comment.
P3: home_dir()? runs before dispatch, so sync-codex-config, sync-devin-config, sync-hermes-config and sync-dsh-config now fail when HOME is unset. Only ConfigSync::MergeClaudeSettings reads home (src/config_sync.rs:22), and those four providers ran fine without HOME before this change. Since nix/providers.json wires these commands into activation, any environment that runs them without HOME will now break for no reason. One option: resolve HOME lazily, only for the Claude settings merge.
Review summaryNo blocking findings (no P0 or P1). I reviewed all five fixes: the missing-HOME error, the ureq timeouts, rejecting unknown provider keys in hooks.json,
What I checked:
I could not run 🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🤖 I have created a release *beep* *boop* --- ## [0.9.13](agent-harness-v0.9.12...agent-harness-v0.9.13) (2026-11-12) ### Features * **codex:** apply the secret path policy to the guarded filesystem ([#233](#233)) ([0830fd9](0830fd9)) * **pi:** run Pi shell and file tools inside srt ([#228](#228)) ([37de3ac](37de3ac)) ### Bug Fixes * dedupe the Nix socket in Pi's srt policy and name the failed sidecar write ([#237](#237)) ([1ccafe0](1ccafe0)) * fail on missing HOME, bound GitHub API waits, reject unknown hook keys ([#218](#218)) ([c0b936d](c0b936d)) * **install:** publish atomically and keep Claude settings keys the harness does not own ([#219](#219)) ([c914c76](c914c76)) * **pi:** confirm ask decisions and deliver skills, instructions, and settings ([#223](#223)) ([2e755af](2e755af)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
Closes #215
概要
小さな不具合5件をまとめて修正する.計画: #215 (comment)
HOME未設定時は.へフォールバックせずエラーにする(install/verify/sync-*-config).--prefix指定時は従来どおりPROVIDERS以外のキーを検証エラーにするrecord_failureが失敗せず,元の取得エラーを返す.status 書き込み自体が失敗した場合も元のエラーに context として付与するas_table_like_mutにし,インラインテーブルをキー単位でマージする検証
tests/missing_home.rs(2件),agent_bounds_connect_response_and_body_waits,read_hooks_rejects_an_unknown_provider_key,refresh_reports_the_fetch_error_when_the_recorded_status_is_corrupt,merge_item_keeps_existing_entries_of_an_inline_tablecargo test: 全件成功cargo clippy(lefthook pre-commit)とcargo fmt --check: 成功cargo clippy --all-targetsには既存テストコード由来の警告が残る(本PRの変更箇所は含まない)🤖 Generated with Claude Code