Skip to content

ship artifact v1 file viewing with ranked open actions#63

Merged
tulsi-builder merged 8 commits intomainfrom
codex/tulsi/artifacts
Apr 1, 2026
Merged

ship artifact v1 file viewing with ranked open actions#63
tulsi-builder merged 8 commits intomainfrom
codex/tulsi/artifacts

Conversation

@tulsi-builder
Copy link
Copy Markdown
Collaborator

Overview

Category: new-feature
User Impact: Users can open agent-produced files directly from chat, with one clear primary output and safer handling of local paths.
Problem: Artifact outputs were hard to follow in chat because file paths were inconsistently persisted, local-path opening had permission/scope gaps, and many low-signal tool steps buried the most important output action.
Solution: This PR ships a stateless Artifact V1 flow: backend persistence + default artifacts root, shared path/ranking policy, context-owned resolution, markdown/local link routing, and UI prioritization that surfaces one primary Open file action per assistant message while collapsing noisy internal steps.

Changes

File changes

artifact-v1-debug-retro-2026-04-01.md
Adds a rollout/debug retrospective documenting observed issues, fixes, and follow-up testing ideas. This captures implementation learnings so subsequent artifact iterations can validate the right edge cases.

src-tauri/capabilities/default.json
Adds explicit opener:allow-open-path permissions for home and artifacts paths used by Artifact V1 open actions.

src-tauri/gen/schemas/capabilities.json
Regenerates capability schema output so runtime permissions and generated schema remain aligned.

src-tauri/src/commands/acp.rs
Introduces deterministic default artifact working directory selection and ensures that directory exists before running ACP prompts. This makes no-project chats write to a predictable artifact root.

src-tauri/src/services/acp/mod.rs
Aligns timestamp precision for persisted messages to improve ordering consistency.

src-tauri/src/services/acp/writer.rs
Persists structured assistant content (including tool requests/responses) rather than only flattened text, enabling artifact path recovery after reload and supporting richer UI behavior.

src/features/chat/hooks/ArtifactPolicyContext.tsx
Adds context-owned artifact indexing and display resolution APIs used by chat surfaces. This keeps ranking/ownership logic out of shared bubble rendering code.

src/features/chat/hooks/tests/ArtifactPolicyContext.test.tsx
Covers message-level primary ownership and args-object mapping to tool calls, protecting context-driven artifact rendering behavior.

src/features/chat/lib/tests/artifactPathPolicy.test.ts
Adds policy regression tests for ranking precedence, boosts, dedupe behavior, and root scope allow/block outcomes.

src/features/chat/lib/artifactPathPolicy.ts
Implements message-level ranking/aggregation and tool-call ownership maps that produce one primary candidate plus secondary outputs.

src/features/chat/lib/artifactPathPolicyCore.ts
Introduces core path extraction, normalization, local href resolution, scope checks, and scoring primitives for artifact candidate evaluation.

src/features/chat/ui/ChatView.tsx
Wires ArtifactPolicyProvider into the chat tree and derives allowed roots from project working dirs plus ~/.goose/artifacts.

src/features/chat/ui/MarkdownContent.tsx
Routes local markdown links through artifact policy resolution/open helpers while preserving normal external link behavior.

src/features/chat/ui/MessageBubble.tsx
Collapses low-signal internal tool steps behind an explicit toggle so primary actions remain visible and the timeline is easier to scan.

src/features/chat/ui/ToolCallCard.tsx
Renders a prominent primary artifact action and collapses non-primary candidates under More outputs (N), including blocked-state/error messaging.

src/features/chat/ui/tests/MarkdownContent.test.tsx
Adds tests for allowed local open, blocked local path behavior, and unchanged external-link handling.

src/features/chat/ui/tests/MessageBubble.test.tsx
Adds coverage for internal-step collapse/toggle behavior in tool-call chains.

src/features/chat/ui/tests/ToolCallCard.test.tsx
Validates primary-host rendering, secondary collapse behavior, and blocked candidate interaction semantics.

src/test/setup.ts
Adds a resilient in-memory localStorage fallback with a complete Storage API so test runs remain stable in this environment.

Reproduction Steps

  1. Start a chat with and without a selected project directory.
  2. Ask the agent to create multiple files (for example, markdown + JSON + HTML) in one response.
  3. Confirm exactly one prominent Open file action appears for the message and additional outputs are under More outputs (N).
  4. Click the primary action and verify the file opens; click a blocked/out-of-scope candidate and verify it is disabled with a reason.
  5. Include a local markdown link in assistant output and confirm allowed links open while external links keep normal behavior.
  6. In a long tool chain, confirm low-signal internal commands are collapsed by default and can be expanded via toggle.
  7. Run pnpm test, pnpm check, and pnpm build and confirm all pass.

Screenshots/Demos

  • Before: many tool/result pills appeared with equal visual weight, and artifact-open affordances were inconsistent.
  • After: one clear primary artifact action is surfaced per message, secondary outputs are collapsed, local markdown links honor scope policy, and internal tool noise is collapsed behind a toggle.

@tulsi-builder tulsi-builder force-pushed the codex/tulsi/artifacts branch from e2ec2fb to 94afc72 Compare April 1, 2026 20:36
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2ec2fbfb0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tulsi-builder tulsi-builder merged commit 0b5a622 into main Apr 1, 2026
7 checks passed
@tulsi-builder tulsi-builder deleted the codex/tulsi/artifacts branch April 1, 2026 21:26
tellaho added a commit to tellaho/goose2 that referenced this pull request Apr 2, 2026
Merges 7 commits from main into tho/boss-ui:
- Image paste support in chat input (block#68)
- Tab name text unselectable (block#67)
- Chat title immediate update on send (block#66)
- Artifact v1 file viewing (block#63)
- Cmd+W tab close (block#64)
- Chat activity/unread state tracking (block#62)
- Sidebar hierarchy polish + faster reloads (block#61)

Key conflict resolutions:
- Keep Tailwind v4 CSS-based config (delete tailwind.config.js)
- Keep boss-ui dialog.tsx, add showCloseButton prop from main
- Add text-foreground-subtle token to boss-ui theme system
- Keep ToolCallAdapter (boss-ui), adopt ToolChainCards pattern from main
- Delete MarkdownContent/ToolCallCard (replaced by boss-ui ai-elements)
- Adopt SessionActivityIndicator from main into sidebar
- Adopt ClickableImage/ImageLightbox from main
- Merge drag-and-drop image support into ChatInput
- Keep boss-ui hover:bg-accent/50 treatment throughout sidebar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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