fix(agent): skip super context for context-free first turns#4403
fix(agent): skip super context for context-free first turns#4403YOMXXX wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds message-based skip logic for super context, threads it through the turn gate, and updates unit tests for greeting, attachment-first, and local folder creation cases. ChangesSuper Context Gating
Estimated code review effort: 2 (Simple) | ~15 minutes Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/openhuman/agent/harness/session/turn/core.rs (1)
87-119: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winPrefix-only matching misses common phrasings of folder-creation requests.
starts_withon the literal action phrases (e.g."create a folder ") only catches messages that begin exactly with the command. Realistic first-turn prompts like "please create a folder for…" or "can you make a directory named…" won't match, so the skip won't apply and super context still runs — undercutting the PR's stated goal of skipping "simple local folder/directory creation requests" for such phrasings. This degrades gracefully (extra scout run, not an incorrect skip), so it's a coverage gap rather than a correctness bug.Consider stripping a small set of common leading filler words/phrases ("please", "can you", "could you", "hey") before the
starts_withcheck, or switching to a light keyword+position heuristic, to broaden coverage.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openhuman/agent/harness/session/turn/core.rs` around lines 87 - 119, The simple local filesystem detection in core.rs only matches folder-creation phrases at the very start of the normalized input, so common requests with leading filler like “please” or “can you” are missed. Update the logic around starts_like_local_folder_action to handle a small set of leading polite phrases before checking the existing prefixes, or replace the strict starts_with gate with a lightweight keyword/position heuristic. Keep the current context_hints filter and simple_local_filesystem_action return path intact so the broader behavior remains the same.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/openhuman/agent/harness/session/turn/core.rs`:
- Around line 688-699: The super-context gating logic is duplicated in
core::agent_loop between the logging block and should_run_super_context, so
extract and reuse a shared helper or the existing classifier result to keep the
base gate consistent. Update the super_context_base_gate check to derive from
the same logic used by should_run_super_context, and rename the local
super_context_skip_reason binding in the same scope to avoid shadowing the
super_context_skip_reason function and reduce confusion.
---
Nitpick comments:
In `@src/openhuman/agent/harness/session/turn/core.rs`:
- Around line 87-119: The simple local filesystem detection in core.rs only
matches folder-creation phrases at the very start of the normalized input, so
common requests with leading filler like “please” or “can you” are missed.
Update the logic around starts_like_local_folder_action to handle a small set of
leading polite phrases before checking the existing prefixes, or replace the
strict starts_with gate with a lightweight keyword/position heuristic. Keep the
current context_hints filter and simple_local_filesystem_action return path
intact so the broader behavior remains the same.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6b40c172-52fb-4f38-b908-0533f4604cf8
📒 Files selected for processing (1)
src/openhuman/agent/harness/session/turn/core.rs
Summary
Ciaoandhello!.SuperContextMiddlewaregraph node.Problem
Solution
super_context_skip_reason()as a pure gate helper for greetings and simple local folder/directory creation prompts.should_run_super_context()to require that no skip reason applies.Submission Checklist
diff-cover) meet the gate enforced by.github/workflows/pr-ci.yml. CI coverage gate will enforce this PR; focused Rust tests were run locally.## Related— no matrix feature row applies.Closes #NNNin the## RelatedsectionImpact
Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/GH-4361-tool-mismapping673b72837Validation Run
pnpm --filter openhuman-app format:check— Rust-only change.pnpm typecheck— Rust-only change.GGML_NATIVE=OFF cargo test --manifest-path Cargo.toml --lib super_context_gate_tests -- --nocapture(pre-merge: 11 passed; after upstream merge: 10 passed)cargo fmt --all -- --check;git diff --check;GGML_NATIVE=OFF cargo check --manifest-path Cargo.tomlValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
super_context_gate_tests.Duplicate / Superseded PR Handling
Summary by CodeRabbit