Skip to content

Improve agentapi module abstraction for configuration and flags #696

Description

@blinkagent

Summary

Currently, starting agentapi and passing flags is the responsibility of individual agent modules rather than a shared base agentapi module. This leads to repeated code across modules.

Current State

Each module implements its own agentapi invocation with various flags:

agentapi server --type opencode --term-width 67 --term-height 1190 -- opencode "${ARGS[@]}"
agentapi server --type amp --term-width=67 --term-height=1190 -- bash -c "echo \"$PROMPT\" | amp" "${ARGS[@]}"
agentapi server --type claude --term-width 67 --term-height 1190 -- claude "${ARGS[@]}"
agentapi server --term-width=67 --term-height=1190 -- aider --model $ARG_MODEL --yes-always

Proposed Improvement

  1. A configuration agentapi module could provide a standardized agentapi command that operates in a certain way (e.g., with regards to state persistence)

  2. Common configuration options could be passed as module variables:

    • --type
    • --term-width
    • --term-height
    • --state-file
  3. Agent-specific startup logic can be written to a shell script that gets executed by the agentapi server:

    agentapi server --type claude --state-file="/tmp/agent.state.json" --term-width 67 --term-height 1190 -- ./start-agent.sh

Related


Created on behalf of @work-jaykumar

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions