Skip to content

feat: agent-aware links & agent_id in API responses (v4.6.0 / v4.6.1) - #104

Merged
csoscd merged 4 commits into
mainfrom
feature/agent-web-identity
Aug 3, 2026
Merged

feat: agent-aware links & agent_id in API responses (v4.6.0 / v4.6.1)#104
csoscd merged 4 commits into
mainfrom
feature/agent-web-identity

Conversation

@csoscd

@csoscd csoscd commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • v4.6.0 – Agent-aware notification links via web-identity push: E-Mail- und Telegram-Links enthalten ?agent_id=X, Web-Container pusht seine Identität an alle Agents (PUT /settings/web-identity), BaseController::selectedAgent() liest $_GET['agent_id'] für Login-Redirects nach Session-Ablauf
  • v4.6.1agent_id als erstes Feld in allen agent-spezifischen API-Antworten (Jobs, Maintenance, Export, Audit, Settings, Timeline, Tags); alle UI-Links (Sidebar, Breadcrumbs, Paginierung, Filter-Reset, Dashboard-Failure-Links) tragen ?agent_id=X; Controller-Redirects nutzen agentPath()

Motivation

Job-IDs sind nur pro Agent eindeutig, nicht global. Ohne agent_id-Kontext landen geteilte Links, Benachrichtigungs-E-Mails und API-Antworten im Multi-Agent-Betrieb beim falschen Agent.

Test plan

  • PHP Tests grün (288 Tests)
  • Security checks grün
  • Dev Docker Images erfolgreich gebaut
  • Manueller Test: Notification-Link öffnet korrekten Agent nach Session-Ablauf
  • Manueller Test: Dashboard-Fehler-Links zeigen Timeline des richtigen Agents
  • Manueller Test: Alle UI-Links behalten ?agent_id=X durch Navigation

csoscd added 4 commits August 3, 2026 13:29
Notification links (email / Telegram) now include ?agent_id=X so that
clicking them activates the correct agent context directly – even after
session expiry, because the login-redirect preserves the parameter.

- New agent endpoint PUT /settings/web-identity stores the web
  container's public URL and agent ID in agent_settings (section "web")
- MailNotifier and TelegramNotifier read web.web_url / web.web_agent_id
  from the DB-backed config and append ?agent_id=X to all links
- WEB_URL moves from the agent container to the web container
  (app.web_url in config.json); agents receive the value via push
- AgentIdentityPusher pushes identity on web startup, agent
  create/update/select; BaseController::selectedAgent() auto-switches
  the session agent from ?agent_id= URL parameters
- GET /api/v1/agents response gains web_url field
- GET /api/v1/settings returns the new web section (read-only via API)
- Tests: WebIdentityEndpointTest (9), NotificationUrlBuilderTest (8),
  3 new cases in AgentsApiControllerTest; 288/288 green
Fixes 6 security advisories reported 2026-07-20 (all affecting <7.15.1):
cookie disclosure/injection, URI fragment leaks in Referer, unbounded
response cookies (DoS), host-only cookie scope bypass, Proxy-Authorization
header leakage. The constraint ^7.8 in composer.json already allows this
version; only composer.lock updated.
Job IDs are only unique per agent, not globally. Without agent_id
context, shared links and API consumers cannot reliably identify
which agent a job belongs to.

- REST API: every agent-specific endpoint (jobs, maintenance,
  export/json, audit, settings, timeline, tags) now includes
  "agent_id" as the first field in its response. BaseApiController
  stores resolvedAgentId in agentClient() and controllers inject it
  via array_merge.

- UI links: all internal links in layout, cron list/detail/form/
  monitor/import/transfer, dashboard, timeline, audit, maintenance
  list/form, housekeeping and error templates now carry ?agent_id=X
  when an agent is active. Controller redirects use new
  BaseController::agentPath() helper.

- Pagination and filter-reset links preserve agent_id via $agParam
  prefix pattern in list templates.

- API.md: §5 documents the agent_id field; all response examples
  updated; §19 changelog entry for v4.6.1.

- CHANGELOG.md: v4.6.1 entry added.
@csoscd
csoscd merged commit 74e28e4 into main Aug 3, 2026
9 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