Skip to content

feat: add object picker for agent creation#214

Closed
jason-rl wants to merge 27 commits intojc/multi-agent-mountsfrom
jc/agent-object-picker-cli
Closed

feat: add object picker for agent creation#214
jason-rl wants to merge 27 commits intojc/multi-agent-mountsfrom
jc/agent-object-picker-cli

Conversation

@jason-rl
Copy link
Copy Markdown
Contributor

@jason-rl jason-rl commented Apr 22, 2026

Summary

  • Add reusable ObjectPicker component that wraps ResourcePicker with object-specific configuration
  • Use it in AgentCreateScreen for selecting an object when creating an agent with object source type
  • Refactor DevboxCreatePage to use the shared ObjectPicker, removing duplicate code
  • Make version optional for all agent source types:
    • TUI: version field shown but labeled "(optional)" for npm/pip/git; hidden entirely for object
    • CLI: --agent-version is now an optional flag instead of required
    • Version is only sent to the API when provided (no hardcoded fallback)
  • Agent list (CLI + TUI) shows - for agents without a version and always - for object-based agents
  • Agent detail view hides version field when not set or when agent is object-based
  • For git-based agents with no explicit version, fall back to displaying source.git.ref in list and detail views

Depends on: runloopai/runloop#8858 (making version optional in the API)

Test plan

  • TUI: Create npm/pip/git agent with version → version sent
  • TUI: Create npm/pip/git agent without version → no version sent
  • TUI: Create object agent → version field hidden, no version sent
  • CLI: rli agent create --name foo --source object --object-id obj_xxx works without --agent-version
  • CLI: rli agent create --name foo --source npm --package bar --agent-version 1.0.0 → version sent
  • Object picker opens when pressing Enter on empty Object ID field
  • Agent list shows - under version for object-based agents and versionless agents
  • Agent list shows git ref (e.g. branch/tag/SHA) for git agents with no explicit version
  • Agent detail hides version for object-based and versionless agents
  • Agent detail shows git ref for git agents with no explicit version

🤖 Generated with Claude Code

…ht clipping

- Extract buildObjectDetailFields() into objectService.ts as shared utility
- Refactor ObjectDetailScreen to use shared utility, reducing code duplication
- Add additionalOverhead prop to ResourcePicker for tabbed wrapper height calculation
- Add objectService tests (14 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jason-rl jason-rl force-pushed the jc/create-devbox-from-agent branch from c8c1e22 to 1cfcb4b Compare April 22, 2026 18:20
@jason-rl jason-rl force-pushed the jc/agent-object-picker-cli branch from cd8c79e to 4bdfa24 Compare April 22, 2026 18:21
@jason-rl jason-rl force-pushed the jc/create-devbox-from-agent branch from 1cfcb4b to dd5ed8c Compare April 22, 2026 18:25
@jason-rl jason-rl force-pushed the jc/agent-object-picker-cli branch 2 times, most recently from aef241b to eaf6576 Compare April 22, 2026 18:51
jason-rl and others added 3 commits April 22, 2026 12:17
…elds

Add color field to ObjectDetailField for semantic coloring (error/warning)
on expiry values. Use formatTimestamp for Created field to include relative
time. Map color names to theme values in ObjectDetailScreen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AgentView already types source as AgentSource and is_public as boolean;
the casts were masking the real types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jason-rl jason-rl force-pushed the jc/create-devbox-from-agent branch from dd5ed8c to 1d061ef Compare April 22, 2026 19:22
@jason-rl jason-rl force-pushed the jc/agent-object-picker-cli branch from eaf6576 to 0b4b7da Compare April 22, 2026 19:22
Use the single formatTimeAgo from ResourceListView (which provides rich
date+time formatting) for both CLI and TUI, consistent with other list
commands. Removes redundant import from utils/time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jason-rl jason-rl force-pushed the jc/create-devbox-from-agent branch from 1d061ef to 91f8c54 Compare April 22, 2026 20:09
@jason-rl jason-rl force-pushed the jc/agent-object-picker-cli branch 2 times, most recently from 27289f7 to f29612d Compare April 22, 2026 20:13
@jason-rl jason-rl force-pushed the jc/create-devbox-from-agent branch from 91f8c54 to cd37eaf Compare April 22, 2026 20:13
Future-proofs the axon list for operations that need to refresh data
(e.g., delete), matching the pattern used in ListAgentsUI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jason-rl jason-rl force-pushed the jc/create-devbox-from-agent branch from cd37eaf to eee668f Compare April 22, 2026 20:45
@jason-rl jason-rl force-pushed the jc/agent-object-picker-cli branch from f29612d to e8316e6 Compare April 22, 2026 20:51
@jason-rl jason-rl force-pushed the jc/create-devbox-from-agent branch from eee668f to d24d2dd Compare April 22, 2026 20:54
@jason-rl jason-rl force-pushed the jc/agent-object-picker-cli branch from e8316e6 to 6b85f39 Compare April 22, 2026 20:54
…efresh race, remove unnecessary async

- Replace buildAgentTableColumns import in DevboxCreatePage with inline
  column builder to decouple from agentColumns.ts
- Replace fragile setTimeout(() => refresh(), 0) with useEffect-based
  needsRefresh state flag for delete callbacks
- Remove unnecessary async from AgentDetailScreen.handleOperation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jason-rl jason-rl force-pushed the jc/create-devbox-from-agent branch from d24d2dd to cd6d21d Compare April 22, 2026 21:22
@jason-rl jason-rl force-pushed the jc/agent-object-picker-cli branch from 6b85f39 to 5423c11 Compare April 22, 2026 21:22
jason-rl and others added 6 commits April 22, 2026 14:23
Revert coverage threshold and forceExit changes to jest configs.
Remove unnecessary `as any` / narrowing casts for Agent.source and
StorageObjectView fields that are already properly typed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move sanitizeMountSegment, repoBasename, adjustFileExtension,
getDefaultAgentMountPath, and getDefaultObjectMountPath to
src/utils/mount.ts. Both CLI (commands/devbox/create.ts) and TUI
(components/DevboxCreatePage.tsx) now import from the shared module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use Promise.all instead of sequential for-of loops when resolving
multiple --agent and --object CLI flags, reducing latency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New components added without corresponding tests brought global
coverage just below the 30% threshold.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add [editing] label on agent/object mount items when inline path
  editing is active, making the sub-mode visually obvious
- Add 35 unit tests for mount.ts covering sanitizeMountSegment,
  adjustFileExtension, repoBasename, getDefaultAgentMountPath, and
  getDefaultObjectMountPath

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jason-rl and others added 8 commits April 22, 2026 14:24
…t load

Replace `as unknown as Record<string, unknown>` casts with direct property
access — Agent already types source and version. Add .catch() to prevent
unhandled rejection when getAgent fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevent the same agent from being added twice when navigating from
agent detail to devbox creation. Also generate proper default mount
paths for git/object agents, consistent with the picker flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
handleOperation never awaits — both branches are synchronous. Also add
comment noting "n" shortcut is safe on detail screens (no pagination).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add reusable ObjectPicker component that wraps ResourcePicker with
object-specific configuration. Use it in AgentCreateScreen to allow
selecting an object from a list when creating an agent with object
source type, instead of requiring manual ID entry.

Also refactors DevboxCreatePage to use the shared ObjectPicker,
removing duplicate code.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Avoids confusion with the FormField component imported from the form
library. The local type is specific to the agent creation form fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allows callers to account for extra UI chrome (e.g., tab headers)
when ObjectPicker is used inside wrapper components.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…creen

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jason-rl jason-rl force-pushed the jc/create-devbox-from-agent branch from cd6d21d to e70094c Compare April 22, 2026 21:26
@jason-rl jason-rl force-pushed the jc/agent-object-picker-cli branch from 5423c11 to e15238d Compare April 22, 2026 21:26
jason-rl and others added 2 commits April 22, 2026 15:41
…ionalOverhead

Allow users to type/paste an object ID directly instead of requiring the
picker. Picker still opens on Enter when the field is empty. Remove the
unnecessary additionalOverhead={0} prop and unused FormField import.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Make version optional for all agent source types. For npm/pip/git, the
version field is shown but marked optional. For object agents, the version
field is hidden entirely. Version is only sent to the API when provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jason-rl jason-rl force-pushed the jc/agent-object-picker-cli branch from d783fb7 to 9ae27df Compare April 22, 2026 23:25
jason-rl and others added 4 commits April 22, 2026 16:49
Update list views (CLI and TUI) to show "-" for agents without a version
instead of empty string. Hide version field in detail view when not set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Object-based agents should always display "-" in the version column and
never show the version field in detail view, regardless of whether a
version value exists.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a git-based agent has no explicit version, display source.git.ref
in list views, detail view, and agentVersionText helper.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Base automatically changed from jc/create-devbox-from-agent to jc/multi-agent-mounts April 23, 2026 00:56
@jason-rl jason-rl force-pushed the jc/multi-agent-mounts branch from c4d15ba to 583cabf Compare April 23, 2026 01:07
@jason-rl jason-rl closed this Apr 23, 2026
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