Skip to content

Conversation

@vsilent
Copy link
Collaborator

@vsilent vsilent commented Jan 16, 2026

No description provided.

vsilent and others added 29 commits January 5, 2026 14:34
- Parse incoming commands to detect stacker command types
- Execute health checks via Docker integration with container metrics
- Execute logs commands with pagination and redaction
- Execute restart commands with force option support
- Fall back to shell execution for unknown commands
- Report all results back to Stacker API endpoint
…nested item object, handle null item, properly handles no command message, map field names - Maps Stacker s type → name and parameters → params. Extract app_code - Pulls app_code from the parameters if present
Problem:
- Agent was POSTing to /api/v1/agent/commands/{command_id}/report (404)
- Stacker expects /api/v1/agent/commands/report (no path parameter)
- Request body was missing required fields: command_id, deployment_hash, completed_at

Root Cause:
- Line 245 in http_polling.rs incorrectly constructed URL with command_id
- Function signature didn't accept deployment_hash and completed_at parameters
- Stacker's report handler requires these fields per CommandReportRequest struct

Solution:
1. Remove command_id from URL path (line 247)
2. Add command_id, deployment_hash, completed_at to request body
3. Update report_result() signature to accept all required parameters
4. Update execute_and_report() to pass deployment_hash from polling_loop
5. Fix test to match new function signature

This resolves the 404 error. The previous 403 was fixed by Casbin migration.

Related:
- stacker/migrations/20260114160000_casbin_agent_role_fix.up.sql

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
….rs.Removed needless borrows in daemon.rs.Added #[allow(clippy::too_many_arguments)] to report_result in http_polling.rs
…th/restart so Stacker’s validator accepts them
@vsilent vsilent merged commit 965c7c3 into trydirect:master Jan 16, 2026
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant