Skip to content

revert(site): Remove SITE-001 agent website reverse-proxy (#865) - #867

Merged
vybe merged 1 commit into
devfrom
feature/865-remove-site001-proxy
May 17, 2026
Merged

vybe merged 1 commit into
devfrom
feature/865-remove-site001-proxy

Conversation

@vybe

@vybe vybe commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes routers/site.py (httpx streaming reverse-proxy to agent port 3000), SITE_PORT constant, nginx /site/ proxy block, and "Website" link-type option in PublicLinksPanel.vue
  • Blocks link_type='site' creation at the API layer (returns 400) to prevent dead links until the SITE-002 replacement lands
  • Updates architecture.md, feature-flows.md, and feature-flows/public-agent-links.md to document the revert and point to the companion redesign

Why

Three design flaws identified in design review:

  1. XSS/same-origin risk — arbitrary HTML/JS from agents served on the Trinity origin; Content-Security-Policy was explicitly stripped by the proxy
  2. Process management burden — agents must start and keep alive a port-3000 web server with no framework standardization or crash recovery
  3. Missing permission gate — file_sharing_enabled flag on agent_ownership was not checked; any agent with a site-type link bypassed the opt-in guard

What was kept (for SITE-002 reuse)

  • agent_public_links.type DB column and schema (migration preserved)
  • AuditEventType.SITE_ACCESS in platform_audit_service.py
  • Docker volume infrastructure (agent-{name}-public, /home/developer/public/)
  • file_sharing_enabled flag on agent_ownership
  • Public link token system (FILES-001 uses it independently)

Changes

  • src/backend/routers/site.py — deleted
  • src/backend/config.py — removed SITE_PORT = 3000
  • src/backend/main.py — removed import + app.include_router(site_router)
  • src/frontend/nginx.conf — removed location /site/ block
  • src/backend/routers/public_links.py — removed SITE_PORT import; reject link_type='site' with 400
  • src/frontend/src/components/PublicLinksPanel.vue — removed "Website" link-type selector and badge
  • src/backend/db_models.py — updated comments
  • tests/test_site_proxy.py — deleted (tests for deleted implementation)
  • tests/registry.json — removed entry

Test Plan

  • Existing tests pass: pytest tests/test_public_links.py -v
  • POST /api/agents/{name}/public-links with link_type='site' returns 400
  • POST /api/agents/{name}/public-links with link_type='chat' (default) still works
  • GET /site/{token}/ returns 404 (nginx block removed)
  • PublicLinksPanel create modal no longer shows "Website" option

Fixes #865

🤖 Generated with Claude Code

Three design flaws warranted full revert: XSS/same-origin risk from
arbitrary agent HTML served on the Trinity origin, process management
burden (agents must run and keep alive a port-3000 web server), and
missing file_sharing_enabled permission gate on site-type links.

Removes routers/site.py, SITE_PORT constant, nginx /site/ block, and
the "Website" link-type option in PublicLinksPanel.vue. Also blocks
link_type='site' creation at the API layer (returns 400) to prevent
dead links until the dashboard.yaml-based SITE-002 replacement lands.

Keeps: agent_public_links.type DB column, AuditEventType.SITE_ACCESS,
Docker volume infrastructure, file_sharing_enabled flag — all reused
by the companion SITE-002 redesign issue.

Fixes #865

Co-Authored-By: Claude <[email protected]>
@vybe
vybe merged commit 09c8bec into dev May 17, 2026
9 checks passed
AndriiPasternak31 added a commit that referenced this pull request May 17, 2026
Brings in 11 commits since the previous rebase (ba4aeae → 09c8bec),
including the SITE-001 revert (#867), the cleanup retention status-value
fix (#864), and the 60-min default execution timeout (#841).

Conflict resolved: src/backend/db/migrations.py — kept dev's two new
migration entries (default_execution_timeout_to_3600,
fix_retention_index_status_values) first, then our execution_retry_count
appended. All three migration functions defined; order matches each
side's landing chronology.

Phase A (test_cleanup_unreachable_orphan.py helper-pair) and Phase B
(tests/unit/conftest.py baseline-restore) for #797 verified intact after
auto-merge. Lint clean, voice_auth + cleanup tests pass under seed 12345.

Refs #678
trinity-ability pushed a commit that referenced this pull request Nov 7, 2026
… editable (abilityai/trinity-enterprise#1133)

The three fields join the task detail form's existing one-Save / one-dirty
path (the #867 owner-field shape), prefilled from the task and sending only
what changed — a cleared objective or definition of done goes as `null`,
which is what clears it. The rendered objective / DoD blocks now render only
when those fields are NOT offered (a reader, an archived project, or a done
task), so a contributor never reads the same text twice.

Lengths are checked before the request by the shared
`projectsUtils.validateTaskFields`, used by the create dialog too — so "the
same limits as at creation" holds in both directions, and a paste never
reaches the outer Pydantic cap, whose refusal has no field to show it under.
The count is in CODE POINTS, which is what the server's `len` counts:
`.length` reads 150 emoji as 300 and would refuse a title the server accepts.
Only the fields a save sends are checked, so a legacy stored value over the
limit does not block a status, owner or note change.

A done task shows the three fields disabled with "Reopen the task to change
its …" and Reopen sends the status alone — the server refuses a combined
reopen-and-edit by design. A server refusal that names a field is shown under
that field, keeping what was typed. `edited` and `owner` task-log kinds now
read as "Edited" and "Owner" instead of falling back to "Note".

The #3692 objective-markdown spec moves to a reader, the audience that now
reads that block. Backend, log lines and tests: the private submodule.

Co-Authored-By: Claude Opus 5 <[email protected]>
vybe added a commit that referenced this pull request Nov 9, 2026
… editable (Abilityai/trinity-enterprise#1133) (#4366)

* feat(workspace): a task's title, objective and definition of done are editable (Abilityai/trinity-enterprise#1133)

The three fields join the task detail form's existing one-Save / one-dirty
path (the #867 owner-field shape), prefilled from the task and sending only
what changed — a cleared objective or definition of done goes as `null`,
which is what clears it. The rendered objective / DoD blocks now render only
when those fields are NOT offered (a reader, an archived project, or a done
task), so a contributor never reads the same text twice.

Lengths are checked before the request by the shared
`projectsUtils.validateTaskFields`, used by the create dialog too — so "the
same limits as at creation" holds in both directions, and a paste never
reaches the outer Pydantic cap, whose refusal has no field to show it under.
The count is in CODE POINTS, which is what the server's `len` counts:
`.length` reads 150 emoji as 300 and would refuse a title the server accepts.
Only the fields a save sends are checked, so a legacy stored value over the
limit does not block a status, owner or note change.

A done task shows the three fields disabled with "Reopen the task to change
its …" and Reopen sends the status alone — the server refuses a combined
reopen-and-edit by design. A server refusal that names a field is shown under
that field, keeping what was typed. `edited` and `owner` task-log kinds now
read as "Edited" and "Owner" instead of falling back to "Note".

The #3692 objective-markdown spec moves to a reader, the audience that now
reads that block. Backend, log lines and tests: the private submodule.

Co-Authored-By: Claude Opus 5 <[email protected]>

* test(workspace): pin the task-field limits to the server pair from the public side (Abilityai/trinity-enterprise#1133)

The server-side check that the client's task-field limits (title 200,
objective / definition of done 4000) match the server's skips wherever
the frontend tree is absent, so a drift could stay green. This vitest
spec pins the same pair where public CI always runs it: it executes
validateTaskFields at and one past each boundary (code points, as the
server counts them) and compares the backend constants too when that
module is checked out.

Red with TASK_TITLE_MAX set to 201: "exports the server pair" and
"accepts a title at the limit and refuses one past it".

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Trinity Agent (trinity) <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: trinity-ability <[email protected]>
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