Skip to content

feat(#462): container shell page — Pico CSS + htmx terminal for agent containers#505

Open
hognek wants to merge 2 commits into
jaylfc:masterfrom
hognek:feat/container-shell-clean
Open

feat(#462): container shell page — Pico CSS + htmx terminal for agent containers#505
hognek wants to merge 2 commits into
jaylfc:masterfrom
hognek:feat/container-shell-clean

Conversation

@hognek
Copy link
Copy Markdown
Contributor

@hognek hognek commented May 31, 2026

What

Container shell page at /api/container-shell/{agent_id} — a browser-based terminal for agent containers using incus exec.

  • GET /api/container-shell/{agent_id}: HTML terminal page with dark theme, Pico CSS styling
  • POST /api/container-shell/{agent_id}/exec: execute commands via incus exec, returns HTML fragments via htmx
  • ARIA-annotated for screen readers, auto-scrolling output log
  • Strips ANSI escape sequences for safe display
  • 23 tests covering auth, HTML escaping, terminal output, incus flow

Why

This is a clean recreation of the closed PR #501. The original PR's fork had unrelated git history, making it unmergeable. This branch is built directly from upstream master and contains only the container shell feature.

Testing

pytest tests/routes/test_container_shell.py -v

No JavaScript bundling required — uses Pico CSS (local) and htmx (CDN).

… agent containers

- GET /api/container-shell/{agent_id}: HTML terminal page with dark theme
- POST /api/container-shell/{agent_id}/exec: execute commands via incus exec
- Uses Pico CSS for styling and htmx for AJAX command execution
- ARIA-annotated for screen readers, output log with auto-scroll
- 23 tests covering auth, terminal, escaping, incus flow
- Strips ANSI escape sequences for safe display

Recreated from closed PR jaylfc#501 (fork had unrelated git history)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Warning

Review limit reached

@hognek, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 7 minutes and 40 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c5a9512-007b-4c06-abe2-f47623819c5b

📥 Commits

Reviewing files that changed from the base of the PR and between 335bec8 and f8ee06e.

📒 Files selected for processing (3)
  • tests/routes/test_container_shell.py
  • tinyagentos/app.py
  • tinyagentos/routes/container_shell.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

pass
return 124, f"(command timed out after {_EXEC_TIMEOUT}s)"
except Exception as exc:
return 1, f"(error: {exc})"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Returning internal exception details to users

Exposing internal error information could leak sensitive details about the system or application internals. Consider returning a generic error message instead.

try:
proc.kill()
await proc.wait()
except Exception:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Bare except clause

A bare except: catches all exceptions including system-exiting ones like KeyboardInterrupt and SystemExit. This can make the program harder to debug and interrupt. Consider catching only specific exceptions or at least logging the caught exception.

</div>

<!-- htmx from CDN -->
<script src="$$HTMX_JS$$" integrity="sha384-L6YHG9qPUPXKpqZ1jJGp3Z3vGL5pJE1vJBlbQ3eJR7okILhYZcsW0E6+5jFxVxFE" crossorigin="anonymous"></script>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Potentially truncated integrity hash

The Subresource Integrity hash appears to be truncated (ends with "+5jFxVxFE"). A proper SHA384 integrity hash should be longer and properly base64-encoded. This could weaken the integrity protection against tampered resources.

stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.STDOUT,
)
stdout_bytes, _ = await asyncio.wait_for(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Unlimited command output size could lead to DoS

Reading unlimited output from commands into memory could lead to denial of service through memory exhaustion. Consider implementing output size limits or streaming the output to prevent excessive memory consumption.

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 31, 2026

Test comment

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 31, 2026

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 31, 2026

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 0

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 31, 2026

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
tinyagentos/routes/container_shell.py 69 Returning internal exception details to users
tinyagentos/routes/container_shell.py 65 Bare except clause
tinyagentos/routes/container_shell.py 185 Potentially truncated integrity hash
tinyagentos/routes/container_shell.py 55 Unlimited command output size could lead to DoS

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 31, 2026

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
tinyagentos/routes/container_shell.py 69 Returning internal exception details to users
tinyagentos/routes/container_shell.py 65 Bare except clause
tinyagentos/routes/container_shell.py 185 Potentially truncated integrity hash
tinyagentos/routes/container_shell.py 55 Unlimited command output size could lead to DoS
Other Observations (not in diff)

No issues found in unchanged code that cannot receive inline comments.

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 31, 2026

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
tinyagentos/routes/container_shell.py 69 Returning internal exception details to users
tinyagentos/routes/container_shell.py 65 Bare except clause
tinyagentos/routes/container_shell.py 185 Potentially truncated integrity hash
tinyagentos/routes/container_shell.py 55 Unlimited command output size could lead to DoS
Other Observations (not in diff)

No issues found in unchanged code that cannot receive inline comments.

Files Reviewed (3 files)
  • tinyagentos/routes/container_shell.py - 4 issues
  • tests/routes/test_container_shell.py - 0 issues
  • tinyagentos/app.py - 0 issues

Reviewed by gemma-4-26b-a4b-it-20260403 · 4,251 tokens

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