Skip to content

Fix missing ClickUp artifact tab in conversation - #754

Draft
adriandemian wants to merge 3 commits into
mainfrom
ralphx/ralphx/agent-2c0c77a5
Draft

Fix missing ClickUp artifact tab in conversation#754
adriandemian wants to merge 3 commits into
mainfrom
ralphx/ralphx/agent-2c0c77a5

Conversation

@adriandemian

@adriandemian adriandemian commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add first-class ClickUp support to the agent conversation artifact area so a conversation started from a ClickUp reference can surface a ClickUp tab with task details instead of falling back to the generic plan view.
  • Extend the ticketing flow to bind existing conversations to ClickUp tickets, keep the conversation-ticket cache in sync after ClickUp-started work begins, and route the chat header to the provider-specific artifact tab.
  • Wire ClickUp into the backend conversation/runtime path so ClickUp references can be expanded into prompt context and the chat service has access to ClickUp integration state during queued message processing.

User Impact

  • Conversations created from ClickUp references can now open the ClickUp artifact tab and show the linked task details in the right-hand pane.
  • The ticketing dashboard can bind a ClickUp ticket to an existing conversation, making ClickUp available as a first-class conversation association instead of a hidden edge case.
  • Opening the linked ticket from the conversation header now lands in the ClickUp artifact tab rather than a Jira/Linear-specific fallback.

Technical Context

  • Introduces a ClickUp artifact tab in the agent session store and artifact pane, with lazy-loaded AgentsClickUpTicketPanel rendering the linked task summary, state, assignees, tags, description, and external-link actions.
  • Updates AgentsChatHeader to route linked tickets by their actual provider and teaches the start-conversation flow to recognize ClickUp references, invalidate the ClickUp conversation-ticket query, and select the ClickUp tab after a ClickUp-started conversation is created.
  • Adds linkTicketToConversation to the frontend ticketing API and uses it from the dashboard when binding an existing conversation to a ClickUp ticket.
  • Extends the Rust backend so ClickUpIntegrationService is available in chat processing, ClickUp references can be expanded into prompt context, and the ticketing command surface exposes the ClickUp conversation-linking path.

Risks / Follow-Ups

  • ClickUp visibility still depends on the conversation having a resolvable linked ticket; conversations without that association will continue to show the empty or unavailable state.
  • The new provider-specific routing and prompt expansion paths are ClickUp-only additions, so any regressions would most likely surface as missing tab selection, stale ticket details, or incomplete ClickUp context hydration rather than broader ticketing failures.
View full plan

ClickUp Conversation Context And Artifact Tab Fix

Goal

User report: "I started conversation from the clickup ticket and got sent in the top of conversation but the artifact was not created tab on right with the clickup ticket details and conversation can’t read .. most likely a bug"

Interpretation: starting an Agent conversation from a ClickUp ticket should behave like Jira/Linear starts. The created conversation must keep a durable ticket association, the agent runtime must receive enough ClickUp task context to reason about the issue, and the right-side artifact pane/header must expose the ClickUp ticket details for the user.

Assumptions:

  • The empty Plan tab is not itself the ClickUp ticket surface. Ticket details should appear in a provider-specific or provider-neutral ticket tab, while plan artifacts remain implementation plans.
  • The ClickUp branch naming and composer reference creation are already partially working; the missing behavior is downstream parity after the start action.
  • The fix should preserve existing Jira and Linear behavior without migration-breaking changes.

Evidence

  • frontend/src/components/ticketing/TicketingDashboardView.tsx currently creates composerIntegrationReferences from the selected ticket, so the ClickUp ticket reference can reach conversation start.
  • The same dashboard explicitly disables conversation binding for ClickUp with supportsConversationBinding = activeProvider !== "clickup", which explains why durable linkage is missing.
  • src-tauri/src/application/chat_service/mod.rs resolves Jira and Linear references into runtime prompt context, but does not expand ClickUp references into full ticket details.
  • src-tauri/src/commands/ticketing_commands/mod.rs returns linked Jira/Linear tickets from get_conversation_ticket() and persists Jira/Linear links in link_started_ticket_to_conversation(), while ClickUp is explicitly deferred.
  • frontend/src/stores/agentSessionStore.ts, frontend/src/components/agents/AgentsArtifactPane.tsx, frontend/src/components/agents/useStartAgentConversation.ts, and frontend/src/components/agents/AgentsChatHeader.tsx model right-pane ticket tabs as Jira/Linear-only.
  • Production logs from the affected run showed a ClickUp-derived branch name, but the initial agent prompt did not include the ClickUp task body. That points to incomplete ClickUp parity rather than a transient UI render failure.

Affected Files

  • src-tauri/src/domain/...: add or extend domain models for a durable ClickUp conversation-ticket association, preferably through the smallest provider-neutral shape compatible with existing Jira/Linear code.
  • src-tauri/src/infrastructure/...: add SQLite and memory repository support plus migrations for ClickUp conversation links or a shared ticket-link table.
  • src-tauri/src/application/chat_service/mod.rs: expand ClickUp composer references into full agent prompt context on interactive and queued conversation starts.
  • src-tauri/src/commands/ticketing_commands/mod.rs: wire ClickUp into get_conversation_ticket, link creation, association queries, and invalidation-friendly response payloads.
  • src-tauri/src/application/clickup... or existing ClickUp integration service files: expose a focused task-detail fetch/render method for prompt hydration.
  • frontend/src/stores/agentSessionStore.ts: add clickup as a valid artifact tab or introduce a provider-neutral ticket tab if the local pattern supports it cleanly.
  • frontend/src/components/agents/AgentsArtifactPane.tsx: lazy-load and render the ClickUp ticket panel with a first-paint shell.
  • frontend/src/components/agents/useStartAgentConversation.ts: allow ClickUp-started conversations to open/invalidate the ticket tab.
  • frontend/src/components/agents/AgentsChatHeader.tsx: replace binary Jira/Linear mapping with explicit provider handling.
  • frontend/src/components/ticketing/...: remove ClickUp binding exclusion once backend persistence exists.
  • frontend/src/**/*.test.* and src-tauri/src/**/*test*: add focused regressions before production changes.

Data / State

The implementation should persist a conversation-to-ticket link with enough fields to refetch and display the ticket later:

  • provider: clickup
  • project id and conversation id
  • ClickUp task id and stable URL
  • display key/name used by the UI and header
  • workspace/list metadata only if already available or needed by existing ClickUp APIs
  • timestamps consistent with Jira/Linear link records

Preferred direction: add a provider-neutral conversation_ticket_links model/table only if it can coexist cleanly with the existing Jira/Linear repositories. If that causes a broad rewrite, add a ClickUp-specific repository matching current Jira/Linear patterns and track provider-neutral consolidation as follow-up debt.

Migration requirements:

  • Additive only.
  • No destructive changes to Jira/Linear link tables.
  • Existing conversations without ClickUp links continue to load.
  • If a ClickUp conversation only has a composer reference but no persisted link, prompt hydration may still use the reference for the first turn; durable UI linkage requires the new link write.

Agent And MCP Surface

Agent runtime context should include a concise structured ClickUp task block when a conversation is started from or linked to a ClickUp task:

  • task id/key, title, URL
  • status, priority, assignees, tags if available
  • description/body, preserving useful formatting without dumping unsafe raw HTML
  • recent comments or activity only if current ClickUp service already supports fetching them cheaply and consistently
  • fallback title/URL reference if full hydration fails

The agent should not be asked to fetch ClickUp details itself. The backend should hydrate the prompt before spawning/resuming the provider process, matching Jira/Linear behavior.

UI / UX

The right-side pane should expose ClickUp ticket details after a ClickUp-started conversation is created or reopened.

Expected behavior:

  • A ClickUp tab appears when the conversation has a ClickUp association.
  • Starting work from a ClickUp ticket opens or selects that tab after the conversation is created.
  • The tab paints a lightweight shell immediately, then fetches detailed content.
  • Header ticket links open the correct ClickUp URL and do not fall through to Linear logic.
  • Jira and Linear tab behavior stays unchanged.

Implementation preference: reuse shared ticket-detail primitives where possible. Avoid three independent copies of the same panel logic if a small provider-neutral panel can render the existing normalized ticket shape.

Progression Scenarios

  1. Start conversation from ClickUp ticket: link is persisted, ClickUp tab opens, agent receives full task context, conversation can be reloaded with the same link.
  2. Start conversation from Jira or Linear ticket: behavior remains unchanged.
  3. ClickUp detail fetch fails during start: conversation still starts, prompt contains task title/URL fallback, UI shows an actionable error state in the ClickUp tab.
  4. ClickUp integration is disabled or disconnected after conversation creation: existing linked metadata still displays minimally; refetch paths show a reconnect/error state.
  5. Existing conversations without a linked ticket: no ticket tab is shown and no prompt hydration attempt is made.

Constraints

  • Stay additive for persisted data and response payloads.
  • Keep the first implementation close to existing Jira/Linear architecture unless a provider-neutral abstraction clearly reduces wiring without widening the patch.
  • Preserve frontend first-paint performance for artifact-pane tab changes; lazy-load heavy panels and defer fetches until the shell is visible.
  • Use TDD-first regressions for backend prompt hydration, persistence/link retrieval, and frontend tab behavior.
  • Do not treat ClickUp ticket details as a Plan artifact. The plan artifact is for implementation planning; the ticket detail belongs to a ticket/integration tab.

Avoid

  • Do not add a frontend ClickUp tab that only appears visually but is not backed by durable conversation linkage.
  • Do not hydrate the agent prompt from the frontend; runtime context must be backend-owned.
  • Do not special-case ClickUp only in one start path while queued/resumed starts still miss context.
  • Do not turn this into a broad ticketing rewrite across all providers unless the existing shape forces it.
  • Do not include raw ClickUp HTML or overly large comment histories in prompts without size limits and sanitization.

Decisions

  • Use the existing Jira/Linear behavior as the parity contract for ClickUp.
  • Backend persistence and prompt hydration are required before the frontend tab is considered complete.
  • The first implementation may choose either a ClickUp-specific link repository or a provider-neutral ticket-link repository after inspecting exact repository/migration friction; the acceptance criterion is durable ClickUp linkage without breaking Jira/Linear.
  • The ClickUp artifact surface should be clickup or a provider-neutral ticket tab, not the existing plan tab.

Implementation Steps

  1. Add failing backend tests for ClickUp composer-reference hydration and conversation-ticket persistence.
  2. Implement ClickUp prompt expansion in the ClickUp integration service and wire it into composer_reference_runtime_message().
  3. Add durable ClickUp conversation link storage, repository wiring, and migration coverage.
  4. Extend ticketing commands so link_started_ticket_to_conversation(), get_conversation_ticket(), and association queries handle ClickUp.
  5. Add failing frontend tests for ClickUp tab availability, start-flow tab selection/invalidation, and header URL/provider mapping.
  6. Add the ClickUp artifact tab/panel with lazy loading and first-paint-safe shell behavior.
  7. Remove the dashboard-side ClickUp binding exclusion once the backend contract is live.
  8. Run targeted backend and frontend tests, then perform a manual smoke with a real ClickUp ticket.

Proof Obligations

  • A ClickUp-started conversation persists a retrievable ticket association.
  • The first runtime prompt includes the ClickUp task details needed for the agent to understand the issue without the user pasting text.
  • The right-side pane shows a ClickUp ticket tab after start and after reload.
  • Jira and Linear flows still pass their existing tests.
  • Failed ClickUp refetches degrade gracefully without blocking conversation creation.

Testing Strategy

Backend:

  • Unit test ClickUp reference expansion into runtime prompt context.
  • Repository/migration test for ClickUp conversation link create/read behavior.
  • Command test for get_conversation_ticket() returning ClickUp links.
  • Start-flow test or service-level regression proving composer references trigger ClickUp hydration.

Frontend:

  • Component/hook test that a ClickUp-started conversation selects or exposes the ClickUp tab.
  • Artifact pane test that the ClickUp tab lazy-loads and renders a loading/error/detail state.
  • Header test that ClickUp URLs are handled explicitly.
  • Regression test that Jira/Linear tabs remain visible and unchanged.

Manual smoke:

  • From a real ClickUp ticket, start an Agent conversation.
  • Confirm the right pane shows ClickUp details.
  • Confirm the agent can reference task title/body without the user pasting details.
  • Reload the conversation and confirm the link/tab survive.

Generated by RalphX


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

…c0c77a5

# Conflicts:
#	frontend/src/components/agents/AgentsArtifactPane.test.tsx
#	frontend/src/components/agents/AgentsArtifactPane.tsx
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

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