Skip to content

Commit 87819f3

Browse files
waynemsmithclaude
andcommitted
Remove non-functional @mention resolution patch
The @mention patch fetched /prompts/users via the legacy client, which returns Unauthorized at runtime (verified against live API) — it never resolved a mention, silently posting literal @name text with a stderr warning. Restore the six touched files to upstream state, drop mentions.go/mentions_test.go, and remove the stale skill reference. The fork is now docs-only on top of upstream. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 77a1f31 commit 87819f3

9 files changed

Lines changed: 8 additions & 651 deletions

File tree

internal/client/client.go

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -170,49 +170,6 @@ func (c *Client) Delete(path string) (*APIResponse, error) {
170170
return c.request("DELETE", path, nil)
171171
}
172172

173-
// GetHTML performs a GET request expecting an HTML response.
174-
// Unlike Get, it sets Accept: text/html and does not attempt JSON parsing.
175-
func (c *Client) GetHTML(path string) (*APIResponse, error) {
176-
requestURL := c.buildURL(path)
177-
req, err := http.NewRequestWithContext(context.Background(), "GET", requestURL, nil)
178-
if err != nil {
179-
return nil, errors.NewNetworkError(fmt.Sprintf("Failed to create request: %v", err))
180-
}
181-
182-
c.setHeaders(req)
183-
req.Header.Set("Accept", "text/html")
184-
185-
if c.Verbose {
186-
fmt.Fprintf(os.Stderr, "> GET %s (HTML)\n", requestURL)
187-
}
188-
189-
resp, err := c.doWithRetry(req)
190-
if err != nil {
191-
return nil, errors.NewNetworkError(fmt.Sprintf("Request failed: %v", err))
192-
}
193-
defer func() { _ = resp.Body.Close() }()
194-
195-
respBody, err := io.ReadAll(resp.Body)
196-
if err != nil {
197-
return nil, errors.NewNetworkError(fmt.Sprintf("Failed to read response: %v", err))
198-
}
199-
200-
if c.Verbose {
201-
fmt.Fprintf(os.Stderr, "< %d %s\n", resp.StatusCode, http.StatusText(resp.StatusCode))
202-
}
203-
204-
apiResp := &APIResponse{
205-
StatusCode: resp.StatusCode,
206-
Body: respBody,
207-
}
208-
209-
if resp.StatusCode >= 400 {
210-
return apiResp, c.errorFromResponse(resp.StatusCode, respBody, resp.Header)
211-
}
212-
213-
return apiResp, nil
214-
}
215-
216173
func (c *Client) request(method, path string, body any) (*APIResponse, error) {
217174
requestURL := c.buildURL(path)
218175

internal/client/interface.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ type API interface {
1313
FollowLocation(location string) (*APIResponse, error)
1414
UploadFile(filePath string) (*APIResponse, error)
1515
DownloadFile(urlPath string, destPath string) error
16-
GetHTML(path string) (*APIResponse, error)
1716
}
1817

1918
// Ensure Client implements API interface

internal/commands/card.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ var cardCreateCmd = &cobra.Command{
240240
return newRequiredFlagError("title")
241241
}
242242

243-
description, err := resolveRichTextContent(cardCreateDescription, cardCreateDescriptionFile, getClient())
243+
description, err := resolveRichTextContent(cardCreateDescription, cardCreateDescriptionFile)
244244
if err != nil {
245245
return err
246246
}
@@ -330,7 +330,7 @@ var cardUpdateCmd = &cobra.Command{
330330
cardNumber := args[0]
331331

332332
hasDescriptionInput := cardUpdateDescription != "" || cardUpdateDescriptionFile != ""
333-
description, err := resolveRichTextContent(cardUpdateDescription, cardUpdateDescriptionFile, getClient())
333+
description, err := resolveRichTextContent(cardUpdateDescription, cardUpdateDescriptionFile)
334334
if err != nil {
335335
return err
336336
}

internal/commands/comment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ var commentCreateCmd = &cobra.Command{
142142
return newRequiredFlagError("card")
143143
}
144144

145-
body, err := resolveRichTextContent(commentCreateBody, commentCreateBodyFile, getClient())
145+
body, err := resolveRichTextContent(commentCreateBody, commentCreateBodyFile)
146146
if err != nil {
147147
return err
148148
}
@@ -206,7 +206,7 @@ var commentUpdateCmd = &cobra.Command{
206206
cardNumber := commentUpdateCard
207207

208208
hasBodyInput := commentUpdateBody != "" || commentUpdateBodyFile != ""
209-
body, err := resolveRichTextContent(commentUpdateBody, commentUpdateBodyFile, getClient())
209+
body, err := resolveRichTextContent(commentUpdateBody, commentUpdateBodyFile)
210210
if err != nil {
211211
return err
212212
}

internal/commands/inline_attachments.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,21 @@ import (
66
"os"
77
"strings"
88

9-
"github.com/basecamp/fizzy-cli/internal/client"
109
"github.com/basecamp/fizzy-cli/internal/errors"
1110
)
1211

13-
// resolveRichTextContent reads body content (inline or from a file), resolves
14-
// @Name mentions to ActionText mention attachments using c, then converts the
15-
// result from markdown to HTML. Mentions are resolved before HTML conversion so
16-
// the inserted attachment markup passes through goldmark unchanged.
17-
func resolveRichTextContent(content string, filePath string, c client.API) (string, error) {
12+
func resolveRichTextContent(content string, filePath string) (string, error) {
1813
if filePath != "" {
1914
fileContent, err := os.ReadFile(filePath)
2015
if err != nil {
2116
return "", err
2217
}
23-
return markdownToHTML(resolveMentions(string(fileContent), c)), nil
18+
return markdownToHTML(string(fileContent)), nil
2419
}
2520
if content == "" {
2621
return "", nil
2722
}
28-
return markdownToHTML(resolveMentions(content, c)), nil
23+
return markdownToHTML(content), nil
2924
}
3025

3126
func appendInlineAttachmentsToContent(content string, paths []string) (string, error) {

internal/commands/mentions.go

Lines changed: 0 additions & 262 deletions
This file was deleted.

0 commit comments

Comments
 (0)