-
Notifications
You must be signed in to change notification settings - Fork 5
fix(opencode): exclude loop-state from agent discovery and deployment #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1266,9 +1266,16 @@ deploy_aidevops_agents() { | |||||||||||||||||||||||||||||
| rm -rf "${target_dir:?}"/* | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # Copy all agent files and folders (excluding scripts which are large) | ||||||||||||||||||||||||||||||
| # We copy scripts separately to maintain structure | ||||||||||||||||||||||||||||||
| cp -R "$source_dir"/* "$target_dir/" | ||||||||||||||||||||||||||||||
| # Copy all agent files and folders, excluding: | ||||||||||||||||||||||||||||||
| # - loop-state/ (local runtime state, not agents) | ||||||||||||||||||||||||||||||
| # Use rsync for selective exclusion | ||||||||||||||||||||||||||||||
| if command -v rsync &>/dev/null; then | ||||||||||||||||||||||||||||||
| rsync -a --exclude='loop-state/' "$source_dir/" "$target_dir/" | ||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||
| # Fallback: copy then remove loop-state | ||||||||||||||||||||||||||||||
| cp -R "$source_dir"/* "$target_dir/" | ||||||||||||||||||||||||||||||
| rm -rf "$target_dir/loop-state" 2>/dev/null || true | ||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||
|
Comment on lines
+1274
to
+1278
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the fallback case where
Suggested change
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| if [[ $? -eq 0 ]]; then | ||||||||||||||||||||||||||||||
| print_success "Deployed agents to $target_dir" | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop cleans up incorrectly created agent files from the root of
$OPENCODE_AGENT_DIR. However, the sub-agent generation logic would have also created files inside aloop-statesubdirectory within$OPENCODE_AGENT_DIR. To ensure a complete cleanup, you should also remove this directory. The hardcoded list of files is also a bit brittle.