Skip to content

feat: Add ACP, Spaces, and Agent Registry for Devin Desktop integration#11

Draft
Keramikus-97 wants to merge 3 commits into
mainfrom
devin/1780834118-acp-desktop-integration
Draft

feat: Add ACP, Spaces, and Agent Registry for Devin Desktop integration#11
Keramikus-97 wants to merge 3 commits into
mainfrom
devin/1780834118-acp-desktop-integration

Conversation

@Keramikus-97

@Keramikus-97 Keramikus-97 commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

Implements three modules enabling this integration to work with Devin Desktop and the Agent Client Protocol (ACP) ecosystem. Agents like OpenCode, Codex, and Claude can now register, share context via Spaces, and be managed through a Kanban-style command center.

New modules:

acp.py — Agent Client Protocol

msg = ACPMessage.create(ACPMessageType.REGISTER, sender_id="agent-1", recipient_id="editor-1")
reg = build_opencode_registration()  # pre-configured with code_review, slash_commands, etc.
version = negotiate_version(["1.0", "1.1"])  # highest mutual version (numeric comparison)
validated = validate_message(raw_dict)  # strict type checking on all fields

spaces.py — Shared Context Containers

space = create_space("PR Review", owner_id="opencode-1")
space.add_context(create_context_item(ContextItemType.PR, "PR #5", "Fix bug", "opencode-1"))
results = space.search_context("bug")
merge_spaces(target, source)  # combine contexts, members, and tags (deduped)

agent_registry.py — Multi-Agent Lifecycle Management

registry = AgentRegistry(heartbeat_timeout=60.0)
registry.register(build_opencode_registration(agent_id="oc-1"))
registry.assign_task("oc-1", "Review PR #10")  # rejects ERROR/OFFLINE/SHUTTING_DOWN agents
reviewers = registry.find_by_capability("code_review")
board = registry.to_kanban()  # {"idle": [...], "busy": [...], "error": [...]}

Review fixes (commit 2 — round 1)

  • __init__.py now exports all public functions, not just data types
  • Removed redundant timestamp from heartbeat payload
  • remove_from_space returns False when space_id wasn't in agent's list
  • LearnerProfile.add_xp uses running total instead of O(n²) re-summing
  • validate_message rejects non-string correlation_id values

Review fixes (commit 3 — round 2)

  • RegisteredAgent.to_dict() now includes capability parameters (was silently dropped — ACPRegistration.to_dict() included them but RegisteredAgent.to_dict() didn't)
  • negotiate_version uses numeric version comparison instead of lexicographic sort ("9.0" no longer sorts above "10.0")
  • validate_message rejects non-string message_id, sender_id, recipient_id, protocol_version (previously str(None)"None" was silently accepted)
  • LearnerProfile.xp_progress uses O(1) closed-form 100 * level * (level-1) // 2 instead of O(n) sum()
  • merge_spaces now merges tags from source into target (was only copying items and members)
  • assign_task rejects agents in ERROR/OFFLINE/SHUTTING_DOWN states (previously overwrote status to BUSY)

232 tests, 99% coverage.

Link to Devin session: https://app.devin.ai/sessions/e783b2864bf3411f8832faec6c5f93bf
Requested by: @Keramikus-97

- acp.py: Agent Client Protocol with message types, registration,
  heartbeat, version negotiation, and OpenCode-specific registration
- spaces.py: Shared context containers for multi-agent collaboration
  with context items, search, merge, and filtering
- agent_registry.py: Agent lifecycle management with health tracking,
  Kanban board view, capability-based lookup, and space associations
- 105 new tests across 3 test files, overall 99% coverage (220 total)
- Export all public functions in __init__.py (Devin Review finding)
- Remove redundant timestamp from heartbeat payload
- Fix remove_from_space: return False when space_id not in agent's list
- Fix LearnerProfile.add_xp O(n^2) recalculation with running total
- Validate correlation_id type in validate_message
- Add test for invalid correlation_id type validation
- RegisteredAgent.to_dict() now includes capability parameters (was silently dropped)
- negotiate_version uses numeric version comparison instead of lexicographic sort
- validate_message rejects non-string message_id, sender_id, recipient_id, protocol_version
- LearnerProfile.xp_progress uses O(1) closed-form formula instead of O(n) sum
- merge_spaces now merges tags from source into target (deduped)
- assign_task rejects agents in ERROR/OFFLINE/SHUTTING_DOWN states

232 tests pass, 99% coverage.

@Keramikus-97 Keramikus-97 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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.

1 participant