refactor: extract shared prompt sections into reusable _partials + add system issue reporting#289
Open
refactor: extract shared prompt sections into reusable _partials + add system issue reporting#289
Conversation
…-process launch - Create server/sidecar/ package with 5 focused modules: - tmux_manager.py: pane lifecycle - server_api.py: HTTP callbacks - alerts.py: rule-based + LLM alert detection - metrics.py: WandB reading/posting - gpu.py: GPU detection/retry - Rewrite agent/sidecar_agent.py as the real orchestrator (monitor_job lives here) - Reduce tools/job_sidecar.py to ~80-line CLI shim (deprecated) - launch_run_in_tmux() now spawns monitor_job() in-process via daemon thread - Add optional job_pane parameter — no subprocess, no pane split needed - Deprecate --run-sidecar flag (kept for frozen binary backward compat) - Add 37 unit tests covering all modules (tests/test_sidecar.py)
- skill_manager_test.py: import from skills.manager (moved from server.py) - test_parse_opencode_event.py: import from chat.streaming (moved from server.py) - test_sidecar_integration.py: end-to-end test exercising monitor_job() with real tmux panes and a fake callback server. Tests success, failure, and running status reporting. Auto-skips in CI where tmux is unavailable.
- Add partials infrastructure to PromptSkillManager: _load_partials()
reads _partials/*.md and injects them as partial_<name> variables
- Create 6 partial files:
- goal_and_project_root.md (Goal + Project Root header)
- experiment_tracking.md (CRITICAL experiment tracking block)
- environment_setup.md (Python env detection + setup)
- learn_from_history.md (shell history inspection)
- rules.md (autonomy + auto-commit rules)
- system_issue_reporting.md (NEW: bug reporting via local file + gh CLI)
- Refactor 5 SKILL.md files to use {{partial_*}} variables:
- wild_v2_planning, wild_v2_iteration, wild_v2_idea
- ra_mode_agent, ra_mode_plan
- System issue reporting: agent saves .wild/issues/*.md and attempts
gh issue create --repo hao-ai-lab/research-agent when gh is available
Collaborator
Author
Execution FlowUser Request: Refactor prompts to abstract similar headers + add system issue reporting for research-agent bugs. Approach:
Key design decision: Partials are injected before caller variables, so |
🚀 Preview Deployed
|
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.
Summary
Refactors duplicated sections across prompt SKILL.md files into reusable partials and adds a new system issue reporting feature.
Changes
Partials Infrastructure (
manager.py)_load_partials()method that reads_partials/*.mdfiles and stores their contentrender()to auto-inject partials aspartial_<name>variables before processing caller variables_-prefixed directories when scanning for skills6 Partial Files (
_partials/)goal_and_project_root.mdexperiment_tracking.mdenvironment_setup.mdlearn_from_history.mdrules.mdsystem_issue_reporting.mdSystem Issue Reporting (new feature)
.wild/issues/when it suspects a research-agent system buggh issue create --repo hao-ai-lab/research-agentifghCLI is availableRefactored 5 SKILL.md files to use
{{partial_*}}variables:wild_v2_planning,wild_v2_iteration,wild_v2_ideara_mode_agent,ra_mode_planImpact