Skip to content

Clean up agent-service code structure and reconcile its types with the frontend #5563

Closed as not planned

Description

@bobbai00

Task Summary

The agent-service/ (Bun/TS) codebase has accumulated structural inconsistencies that hurt readability and risk silent wire-contract bugs.

Code structure

Problem Detail
Definitions scattered ~25 interfaces/types live in client/tool/util/server files instead of types/
Duplicate definitions LogicalPlan / PortSchema / InputPortInfo defined twice; AgentSettingsApi is field-for-field identical to UpdateAgentSettingsRequest
Impure "clients" api/ mixes HTTP clients with types, endpoint config, and JWT helpers; the execution HTTP client lives in agent/tools/, while api/execution-api.ts holds only types
Misleading naming AgentDelegateConfig is a runtime binding (not config) and is re-declared inline 3× with conflicting shapes; *Config is used for non-config objects
Duplicate logic jsonToTableFormat and the input/output-shape formatter are duplicated across two files

Inconsistency with the frontend wire contract

The agent reads/writes the same workflow and compile payloads as the Angular frontend, but several types/ definitions have drifted from frontend/src/app/.../*.interface.ts:

Type agent-service (current) frontend (source of truth)
CommentBox {commentBoxID, comments: string, x, y, width, height} {commentBoxID, comments: Comment[], commentBoxPosition: Point}
WorkflowSettings missing executionMode {dataTransferBatchSize, executionMode}
WorkflowFatalError {type: string, message, operatorId?} {message, details, operatorId, workerId, type: {name}, timestamp}

These avoid runtime breakage today only because the code reads a subset of the fields and passes the rest through opaquely — they are latent bugs, not correct shapes.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Activity

  1. added theissue type on Jun 8, 2026
  2. bobbai00 commented on Jun 24, 2026

    @bobbai00
    ContributorAuthor

    Superseded by #5747 and its sub-tasks — the type/structure cleanup and frontend-type reconciliation are covered there (#5749/#5748/#5750). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions