Skip to content

Feat: show agent context attachments - #76

Merged
moonlight16 merged 2 commits into
rossoctl:mainfrom
moonlight16:agent/report-attached-contexts
Aug 21, 2026
Merged

Feat: show agent context attachments#76
moonlight16 merged 2 commits into
rossoctl:mainfrom
moonlight16:agent/report-attached-contexts

Conversation

@moonlight16

Copy link
Copy Markdown
Member

Summary

Display attached context resources in rossoctl agents get and improve the human-readable output of rossoctl context get.

Agent details

When the server returns context attachment metadata, human output now includes a Contexts section showing:

  • Context name
  • Type
  • Mount path
  • Access mode
  • Backing PVC claim

--json preserves the additive contexts field.

Older servers and agents without recorded context metadata continue to work without displaying the section.

Context details

Replace the terse single-line context get output with labeled sections:

  • Context Information
  • Storage
  • Attachment
Context Information
  Name:       research
  Namespace:  team1
  Type:       workspace
  Status:     ready

Storage
  Backend:        pvc
  Size:           1Gi
  Access Mode:    ReadWriteOnce
  Storage Class:  <default>

Attachment
  Kind:   pvc
  Claim:  context-research

Validation

  • CLI command and API model tests pass.
  • Live-tested human and JSON agent output against the updated Rosso backend.
  • Verified labeled context get output against a live context.
  • Verified agents without contexts remain compatible.

Dependency

Requires rossoctl/rossoctl#2447 to populate context attachment metadata. The CLI remains backward-compatible with older servers.

Signed-off-by: Jeremy Cohn <Jeremy.Cohn@ibm.com>
@moonlight16
moonlight16 requested a review from esnible August 20, 2026 20:18

@esnible esnible left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During testing, I noticed that go run . context get research-shared --json sends the output to stderr. So go run . context get research-shared --json > /tmp/c3.json didn't work like I expected.

The new get output looks better, though. Thanks!

Signed-off-by: Jeremy Cohn <Jeremy.Cohn@ibm.com>
@moonlight16

Copy link
Copy Markdown
Member Author

Addressed the stdout issue in fafa6d9:

  • context JSON output now writes explicitly to stdout
  • added a regression test that captures stdout and stderr separately
  • verified live redirection produces valid JSON with empty stderr

Validation: go test ./cmd ./internal/agentapi ./internal/apiclient passes.

@moonlight16
moonlight16 merged commit ca9b2cb into rossoctl:main Aug 21, 2026
2 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.

2 participants