Skip to content

feat(operator): add oabctl logs command#856

Open
chaodu-agent wants to merge 1 commit into
mainfrom
feat/oabctl-logs
Open

feat(operator): add oabctl logs command#856
chaodu-agent wants to merge 1 commit into
mainfrom
feat/oabctl-logs

Conversation

@chaodu-agent
Copy link
Copy Markdown
Collaborator

Summary

Adds oabctl logs to stream CloudWatch logs from an agent's running ECS task.

Usage

oabctl logs kiro-01                # last 100 lines
oabctl logs kiro-01 --follow       # stream (tail -f)
oabctl logs kiro-01 --tail 50      # last 50 lines
oabctl logs kiro-01 --namespace dev --cluster my-cluster

How it works

  1. Finds running task via ECS ListTasks + DescribeTasks
  2. Resolves CloudWatch log group/stream (default: /ecs/oab-{ns}-{name})
  3. Fetches log events via GetLogEvents
  4. With --follow: polls every 2s for new events

Files

  • operator/src/logs.rs — log fetching logic
  • operator/src/main.rs — added Logs subcommand

cc @pahud

Streams CloudWatch logs from an agent's ECS task.

Usage:
  oabctl logs kiro-01              # show last 100 lines
  oabctl logs kiro-01 --follow     # tail -f style
  oabctl logs kiro-01 --tail 50    # last 50 lines

Automatically finds the running task, resolves log group/stream,
and fetches from CloudWatch Logs.
@chaodu-agent chaodu-agent requested a review from thepagent as a code owner May 19, 2026 13:40
@github-actions github-actions Bot added the closing-soon PR missing Discord Discussion URL — will auto-close in 3 days label May 19, 2026
@github-actions
Copy link
Copy Markdown

⚠️ This PR is missing a Discord Discussion URL in the body.

All PRs must reference a prior Discord discussion to ensure community alignment before implementation.

Please edit the PR description to include a link like:

Discord Discussion URL: https://discord.com/channels/...

This PR will be automatically closed in 3 days if the link is not added.

@github-actions github-actions Bot added the pending-screening PR awaiting automated screening label May 19, 2026
@shaun-agent
Copy link
Copy Markdown
Contributor

shaun-agent commented May 19, 2026

OpenAB PR Screening

This is auto-generated by the OpenAB project-screening flow for context collection and reviewer handoff.
Click 👍 if you find this useful. Human review will be done within 24 hours. We appreciate your support and contribution 🙏

Screening report done. posted screening comment and moved the project item to `PR-Screening`.

GitHub comment: #856 (comment)
Project action: moved PVTI_lADOEFbZWM4BUUALzgtMIbA from Incoming to PR-Screening in https://github.com/orgs/openabdev/projects/1

Intent

This PR adds an oabctl logs command so operators can inspect or follow CloudWatch logs for a running OpenAB agent task without manually finding the ECS task and log stream.

Feat

Feature work. New operator CLI subcommand for recent/followed ECS CloudWatch logs.

Who It Serves

Deployers and agent runtime operators.

Rewritten Prompt

Add oabctl logs <agent-name> for ECS deployments, with task discovery, log group/stream resolution, --tail, --follow, clear AWS/task/log errors, and focused tests around parsing, pagination, and follow behavior.

Merge Pitch

Useful operator observability with small diff surface. Main risk is AWS edge-case correctness: task selection, log stream naming, pagination, ordering, and duplicate follow output.

Best-Practice Comparison

OpenClaw/Hermes only partially apply. This is not scheduling or durable execution work, but it aligns with first-class operator visibility. It still relies on CloudWatch rather than OpenAB-owned run logs.

Implementation Options

Conservative: merge if error handling and minimal coverage are acceptable.

Balanced: require mockable AWS boundaries and tests for task discovery, stream resolution, pagination, tailing, and follow tokens.

Ambitious: grow this into broader operator observability: logs, status, task metadata, and eventually OpenAB-owned run logs.

Comparison Table

Included in the GitHub comment.

Recommendation

Balanced path. Keep this PR focused, but require explicit validation of ECS naming assumptions, CloudWatch pagination/follow semantics, and whether /ecs/oab-{namespace}-{name} matches current deployment templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closing-soon PR missing Discord Discussion URL — will auto-close in 3 days pending-screening PR awaiting automated screening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants