Skip to content

[P1][OpenCode] Replace hosted ContextGatheringAgent chat with OpenCode sessions #457

Description

@isayahc

Objective

Make OpenCode the hosted browser chat agent instead of ContextGatheringAgent and the current Forma server-side conversation flow.

Current locations

  • apps/api/context_gathering_api.py:context_gathering_agent() constructs the current agent.
  • apps/api/context_gathering_api.py:gather_project_context_endpoint() owns the current conversation/build handoff.
  • apps/web/app/forma-workspace.tsx submits /projects/{project_id}/context/messages, /generate, and /iterate requests.
  • apps/web/app/forma-workspace/home-chat-view.tsx renders context suggestions, build-now actions, and current progress.

Required behavior

  • OpenCode owns the conversation, project authoring, and revision intent.
  • Forma owns typed Hardware IR compilation, deterministic validation, rendering, persistence, and revision ownership.
  • Use session/message/event APIs backed by durable Vercel records.
  • Do not silently fall back to ContextGatheringAgent, forma.generate_project, or simulated generation.
  • If the connector or OpenCode instance is unavailable, return a typed unavailable state.

Acceptance criteria

  • The allowed test user can use browser chat to create and modify a project through OpenCode.
  • Existing project ownership and revision controls remain enforced.
  • Context questions and server-side build handoffs are removed from OpenCode mode.
  • Legacy endpoints are either removed from hosted chat or explicitly disabled behind a documented migration flag.
  • Browser messages contain only sanitized OpenCode events.

Related

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions