Skip to content

Detected Agent config is display-only; the wizard cannot adopt it #91

Closed as not planned

Description

@yujiezhang-ops

What already works

Startup does parse existing config. internal/app/status.go:323-325 calls configReader.DetectFile() for every auto Agent that has a config path, and internal/config/discovery.go:161 reads the file with a per-adapter parser (ReadCodexConfig, ReadClaudeConfig, ReadOpenAICompatibleConfig, ReadOpenClawConfig, ReadAiderConfig, ReadHermesConfig). The result reaches the UI as AgentStatus.detected and frontend/src/components/AgentManageRow.tsx:78-106 renders it, distinguishing "we wrote this" from 检测到的配置,非 OneAgent 写入 via managedByOneAgent.

So the reading half is done. This issue is about what happens next.

The gap

detected is display-only. Nothing consumes it as input:

  • frontend/src/state/wizardReducer.ts never reads status.agents[id].detected. The wizard seeds its model from providerDefaultModel() (:92), which reads providers[provider].default_model from the manifest — not from what is on disk.
  • frontend/src/pages/AgentSelectionPage.tsx passes state.status.agents through but does not use detected to preselect anything.
  • There is no reverse lookup from a detected baseUrl to a known Provider ID. grep for ProviderForBaseURL / providerForBase / matchProvider finds nothing in internal/ or frontend/src/.
  • There is no "adopt this config" affordance anywhere. EnvironmentOverviewPage.tsx has only three navigate() calls (:22, :25, :29), all of which start the wizard from scratch.

The concrete consequence: a user who already has ~/.codex/config.toml pointing at PPIO with deepseek/deepseek-v4-pro sees that endpoint and model correctly reported in the overview, then still has to walk the full wizard and retype both. OneAgent knows the answer and asks anyway.

There is a second, subtler cost. internal/app/status.go:373 sets firstRun from whether ~/.oneagent exists, and frontend/src/App.tsx:64 routes on it. A user with six configured Agents but no ~/.oneagent is treated as a blank slate.

Suggested scope

  1. Reverse-resolve a detected endpoint to a Provider. Add a lookup from baseUrl to a Provider ID over providers (built-in and user). internal/provider/store.go already holds every entry's BaseURL; normalising through provider.OpenAIBaseURL() before comparing would handle the /v1 variants. Return no match rather than guessing — custom deliberately has no DefaultModel (store.go:99-102) for the same reason.

  2. Seed the wizard from detected when there is no Profile binding. Precedence should sit below an explicit user choice but above the manifest default: chosen > detected > providerDefaultModel > first listed. The current chain at wizardReducer.ts:348 is chosen || probeModel || seeded || models[0]; detected belongs between probeModel and seeded.

  3. Offer adoption explicitly in the overview. targetSummary() already computes the 检测到的配置,非 OneAgent 写入 case at AgentManageRow.tsx:102. That row is exactly where a "create a Profile from this" action belongs — the user can see what would be adopted before agreeing to it.

Deliberate non-goals

Do not auto-adopt silently. Two reasons. detected carries no credential — the readers are documented at internal/config/discovery.go:1-3 as never returning credential values, and Detected has no key field — so adoption can recover the endpoint and model but never the key, and a Profile that looks complete but cannot authenticate is worse than an obviously empty one. And overwriting a hand-maintained config without being asked is the failure mode managedByOneAgent exists to keep visible.

Also do not widen Detected to carry secrets in order to close that gap.

Priority

P2. The reading infrastructure is in place and correct; this is wiring it into the flow that currently ignores it.

Activity

  1. Paulkm2006 commented on Aug 7, 2026

    @Paulkm2006
    Contributor

    To read and convert existing configurations from local agents involves complex config file resolving, environment variable reading and deduplication with existing providers and profiles. Indeed, this function might help advanced users who already installed and configured agents manually to migrate to OneAgent smoothly, but come with a great cost for developers and regular users who won't use it. Marked as not planned for now.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions