Skip to content

Remove unused configuration variables - #32

Merged
AbirAbbas merged 1 commit into
mainfrom
cleanup/remove-unused-config
Dec 1, 2025
Merged

Remove unused configuration variables#32
AbirAbbas merged 1 commit into
mainfrom
cleanup/remove-unused-config

Conversation

@AbirAbbas

Copy link
Copy Markdown
Contributor

Summary

Audited control-plane/config/agentfield.yaml and found many config options that were defined but never actually used by the codebase. This creates confusion for users who set these values expecting them to have an effect.

Removed 103 lines of dead config/struct definitions.

What Was Removed

From YAML config:

Section Removed Fields Reason
agentfield mode, max_concurrent_requests, request_timeout, circuit_breaker_threshold Never wired to any implementation
execution_queue worker_count, request_timeout, lease_duration, max_attempts, failure_backoff, max_failure_backoff, poll_interval, result_preview_bytes, queue_soft_limit, waiter_map_limit Defined but never accessed
ui backend_url Never used
storage.local cache_size, retention_days, auto_vacuum SQLite uses hardcoded values
storage config: {} Generic field never accessed
agents Entire section Discovery/scaling never implemented

From Go structs:

  • AgentsConfig, DiscoveryConfig, ScalingConfig
  • CoreFeatures, EnterpriseFeatures
  • DataDirectoriesConfig
  • Various unused fields in AgentFieldConfig, ExecutionQueueConfig, LocalStorageConfig, StorageConfig, UIConfig

What Remains (All Actively Used)

agentfield:
  port                          # HTTP server port
  execution_cleanup: ...        # All fields used by cleanup service
  execution_queue:
    agent_call_timeout          # Used in ExecuteHandler
    webhook_*                   # Used by WebhookDispatcher

ui:
  enabled, mode, dev_port       # All used for UI serving

api:
  cors: ...                     # All fields passed to Gin CORS middleware

storage:
  mode                          # Used by StorageFactory
  local:
    database_path, kv_store_path  # Used by LocalStorage
  vector:
    enabled, distance           # Used by vector store

features:
  did: ...                      # All fields used by DID/VC services

Test plan

  • go build ./... succeeds
  • go test ./internal/config/... passes
  • go test ./internal/storage/... passes
  • go test ./cmd/... passes
  • go test ./internal/application/... passes
  • go test ./internal/server/... passes

🤖 Generated with Claude Code

Audit of agentfield.yaml revealed many config options that were defined
but never actually read or used by the codebase. This creates confusion
for users who set these values expecting them to have an effect.

Removed from YAML config:
- agentfield: mode, max_concurrent_requests, request_timeout,
  circuit_breaker_threshold (none were wired to any implementation)
- execution_queue: worker_count, request_timeout, lease_duration,
  max_attempts, failure_backoff, max_failure_backoff, poll_interval,
  result_preview_bytes, queue_soft_limit, waiter_map_limit
- ui: backend_url
- storage.local: cache_size, retention_days, auto_vacuum
- storage: config field
- agents section entirely (discovery/scaling never implemented)

Removed from Go structs:
- AgentsConfig, DiscoveryConfig, ScalingConfig
- CoreFeatures, EnterpriseFeatures
- DataDirectoriesConfig
- Unused fields from AgentFieldConfig, ExecutionQueueConfig,
  LocalStorageConfig, StorageConfig, UIConfig

The remaining config options are all actively used:
- agentfield.port, execution_cleanup.*, execution_queue webhook settings
- ui.enabled/mode/dev_port
- api.cors.*
- storage.mode/local.database_path/local.kv_store_path/vector.*
- features.did.* (all DID/VC settings)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@santoshkumarradha

Copy link
Copy Markdown
Member

LGTM, old v0.1 reminiscent configs.

@santoshkumarradha

Copy link
Copy Markdown
Member

@AbirAbbas cache_size, retention_days, auto_vacuum - lets add it to backlog probably to be added to memory api but was debating to add ttl directly in the rest api for per memory setting. Good prod grooming backlog.

@AbirAbbas
AbirAbbas merged commit c51feda into main Dec 1, 2025
19 checks passed
AbirAbbas added a commit that referenced this pull request Apr 20, 2026
…erless-discovery

security: fix SSRF in serverless agent discovery (CodeQL alert #32)
AbirAbbas added a commit to kiranannadatha8/agentfield that referenced this pull request Apr 21, 2026
…ted parts

Fixes CodeQL go/request-forgery (CWE-918) alert Agent-Field#32 on
RegisterServerlessAgentHandler by splitting normalizeServerlessDiscoveryURL
into a parse helper that returns a freshly constructed *url.URL (validated
scheme literal, allowlisted host, path.Clean-ed path, no user/query/fragment
propagated) and having the handler build the /discover URL from those
sanitized components rather than string-concatenating the caller-supplied
value. Also rejects opaque URLs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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