Skip to content

refactor(api): make agents canonical - #2894

Merged
chocobar merged 4 commits into
mainfrom
codex/unify-agent-app-model
Jul 29, 2026
Merged

refactor(api): make agents canonical#2894
chocobar merged 4 commits into
mainfrom
codex/unify-agent-app-model

Conversation

@chocobar

Copy link
Copy Markdown
Collaborator

Summary

  • make Agent the canonical API model while retaining App as a deprecated source alias
  • expose /api/v1/agents and retain /api/v1/apps as an undocumented runtime alias
  • migrate Helix consumers and org links to canonical agent naming while preserving storage and wire compatibility

Tests

  • go test ./pkg/org/... -count=1
  • targeted server, DTO, and GORM tests
  • go build ./pkg/server/ ./pkg/store/ ./pkg/types/ ./pkg/cli/spectask/
  • yarn tsc --noEmit
  • yarn build
  • deployed to Prime at fc9eacf

chocobar and others added 2 commits July 29, 2026 16:38
Replace deprecated types.App, types.AppConfig, and types.AppHelixConfig
with types.Agent, types.AgentConfig, and types.AgentHelixConfig to fix
staticcheck SA1019 linter errors.
if err := AttachHelixOrgMCP(ctx, c.ProjectService, state.AgentAppID, c.HelixOrgURL, workerID, c.MCPAuthBearer); err != nil && c.Logger != nil {
c.Logger.Warn("helix spawner: attach helix-org MCP", "worker", workerID, "app", state.AgentAppID, "err", err)
if err := AttachHelixOrgMCP(ctx, c.ProjectService, state.AgentID, c.HelixOrgURL, workerID, c.MCPAuthBearer); err != nil && c.Logger != nil {
c.Logger.Warn("helix spawner: attach helix-org MCP", "worker", workerID, "agent", state.AgentID, "err", err)
@chocobar

Copy link
Copy Markdown
Collaborator Author

🔐 CodeQL Security Alert

The CodeQL check completed but flagged 1 medium severity security vulnerability:

File Line Issue
api/pkg/org/infrastructure/runtime/helix/spawner.go 409 Log entries created from user input

Details

The flagged line:

c.Logger.Warn("helix spawner: attach helix-org MCP", "worker", workerID, "agent", state.AgentID, "err", err)

CodeQL detected that err (and possibly state.AgentID) originates from user-provided input and is being logged directly. This can lead to:

  • Log injection attacks where malicious input manipulates log formatting
  • Log forging that can confuse log analysis tools or hide malicious activity

Suggested Fix

Sanitize user-controlled values before logging, or use structured logging that escapes special characters automatically. For example:

c.Logger.Warn("helix spawner: attach helix-org MCP", 
    "worker", workerID, 
    "agent", sanitize(state.AgentID), 
    "err", err.Error())  // Use .Error() string rather than raw error

Alternatively, if the logging framework already handles structured key-value pairs safely, you may be able to suppress this warning with a CodeQL annotation if you've verified it's a false positive.

View full CodeQL report

@chocobar
chocobar merged commit 428592e into main Jul 29, 2026
5 checks passed
@chocobar
chocobar deleted the codex/unify-agent-app-model branch July 29, 2026 16:37
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