feat: add runtime context hint to session greeting#419
Conversation
Output app-specific config paths (e.g. OpenCode global config location) after the version line so the AI model knows where settings are stored. Also adds managed template for the OpenCode config-level AGENTS.md.
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the AI model's operational awareness by embedding crucial runtime context, such as the application name and its global configuration path, directly into the session greeting. This change aims to provide AI models with explicit environmental information, reducing the need for inference and enabling more accurate and context-aware responses. It also includes a new template to guide OpenCode agents on how to properly handle and present this enriched greeting, ensuring consistent behavior across different agent types. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes implement runtime context detection in the update-check script to identify the running application (OpenCode or Claude Code) and append this hint to version output. A new configuration template documents the agent initialization workflow, including update-check script execution and caching behavior for session greetings. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Feb 7 04:28:28 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Code Review
This pull request adds a runtime context hint to the session greeting, which is a helpful feature for the AI model to locate configuration files. The implementation is sound, and it also introduces a new template for agent instructions. I have provided a couple of suggestions to enhance the clarity and maintainability of the shell script and the new markdown template.
| if [[ -n "$runtime_hint" ]]; then | ||
| printf '%s\n%s\n' "$output" "$runtime_hint" > "$cache_dir/session-greeting.txt" | ||
| else | ||
| echo "$output" > "$cache_dir/session-greeting.txt" | ||
| fi |
There was a problem hiding this comment.
The logic for caching the session greeting can be simplified to improve readability and maintainability. Instead of an if/else block with output redirection in each branch, you can use a subshell to group the commands and redirect the output once. This makes the intent clearer and the code easier to follow.
| if [[ -n "$runtime_hint" ]]; then | |
| printf '%s\n%s\n' "$output" "$runtime_hint" > "$cache_dir/session-greeting.txt" | |
| else | |
| echo "$output" > "$cache_dir/session-greeting.txt" | |
| fi | |
| ( | |
| echo "$output" | |
| if [[ -n "$runtime_hint" ]]; then | |
| echo "$runtime_hint" | |
| fi | |
| ) > "$cache_dir/session-greeting.txt" |
| @@ -0,0 +1,15 @@ | |||
| Add ~/.aidevops/agents/AGENTS.md to context for AI DevOps capabilities. | |||
There was a problem hiding this comment.
The first line of this file appears to be a meta-instruction for developers rather than for the AI agent. As plain text, it could be misinterpreted by the agent. If this is a note for humans, it's best practice to enclose it in a Markdown comment to avoid confusion.
| Add ~/.aidevops/agents/AGENTS.md to context for AI DevOps capabilities. | |
| <!-- Add ~/.aidevops/agents/AGENTS.md to context for AI DevOps capabilities. --> |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.agents/scripts/aidevops-update-check.sh (1)
163-167:⚠️ Potential issue | 🟡 MinorRuntime hint and cache are skipped on the
UPDATE_AVAILABLEearly-return path.When an update is available (line 165),
mainreturns before reaching the runtime hint output (line 193) and cache write (line 210). This means:
- The AI model won't receive the runtime context hint when an update is pending.
- The cached
session-greeting.txtwon't be refreshed — agents without Bash will see a stale greeting.If this is intentional (the update banner is a distinct flow), a brief comment would help future maintainers understand the design choice. If it's unintentional, the hint and cache logic should be hoisted above the early return or duplicated in the update branch.
Also applies to: 193-214
🤖 Fix all issues with AI agents
In @.agents/scripts/aidevops-update-check.sh:
- Around line 193-205: The runtime hint for the "Claude Code" case uses an
incorrect config path; update the assignment to runtime_hint inside the case
pattern "Claude Code") so it reads the correct global settings path
(~/.claude/settings.json) instead of ~/.config/Claude/Claude.json, ensuring the
variable runtime_hint contains the accurate hint string that will be echoed
later.
In `@templates/opencode-config-agents.md`:
- Line 11: The template's documented UPDATE_AVAILABLE format is wrong — the
script emits four fields (UPDATE_AVAILABLE|$current|$remote|$app_name) not
three; update the example and user message in the template to match that format
(e.g., `UPDATE_AVAILABLE|current|latest|app_name`) and show how agents should
parse it (include app_name in the displayed message, e.g., "Update available
(app_name: current → latest). Run `aidevops update` to update."). Ensure you
reference the UPDATE_AVAILABLE token and the $current, $remote, $app_name fields
so parsing logic and examples align with the script output.
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Feb 7 04:32:39 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
|
@coderabbitai resolve Fixed the UPDATE_AVAILABLE format mismatch in the template (now shows 4 fields matching the script). The other two items:
|
|
✅ Format fix confirmed - The 4-field UPDATE_AVAILABLE format now matches the script output. ✅ Design explanations accepted:
I'll resolve all the review comments now. ✏️ Learnings added
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! ✅ Actions performedComments resolved and changes approved. |



Summary
templates/opencode-config-agents.md) for the OpenCode config-level AGENTS.md greeting instructionsTested: new sessions now show
You are running in OpenCode. Global config: ~/.config/opencode/opencode.jsonin the greeting context.Summary by CodeRabbit