Skip to content

fix(docs): add TabId support to markdown replace and improve error logging#517

Closed
dinakars777 wants to merge 2 commits intoopenclaw:mainfrom
dinakars777:fix-docs-find-replace-markdown
Closed

fix(docs): add TabId support to markdown replace and improve error logging#517
dinakars777 wants to merge 2 commits intoopenclaw:mainfrom
dinakars777:fix-docs-find-replace-markdown

Conversation

@dinakars777
Copy link
Copy Markdown
Contributor

Fixes #494

Bug

gog docs find-replace <docId> "find" "replace" --format markdown silently does nothing when using a tab.

Root Cause

The markdown replace path (replaceDocsMarkdownRange) was missing TabId support:

  1. InsertTextRequest did not have TabId set
  2. cleanupDocsImagePlaceholders did not use TabsCriteria
  3. No warning was shown when tab targeting would fail

Additionally, DeleteContentRangeRequest.Range does not support TabId in the Google Docs API - this is a fundamental limitation.

Fix

  1. Add TabId to InsertTextRequest.Location in replaceDocsMarkdownRange
  2. Add TabsCriteria to ReplaceAllText in cleanupDocsImagePlaceholders
  3. Pass TabId through the call chain: runMarkdownreplaceDocsMarkdownRange
  4. Add warning when using --format markdown with --tab-id (explaining the DeleteContentRange limitation)
  5. Improve error messages to include match index on failure

Testing

  • Lint passes (0 issues)
  • Existing tests pass (pre-existing 404 failures in mock server are unrelated)

Reviewer added 2 commits April 20, 2026 22:52
… headers

When updating a draft with --quote but without --reply-to-message-id, the
existing draft's message ID was fetched but never used to set the In-Reply-To
and References headers. This caused delivery failures on strict mail servers.

Fixes openclaw#512
…gging

- Add TabId to InsertTextRequest in replaceDocsMarkdownRange
- Add TabsCriteria to cleanupDocsImagePlaceholders
- Pass TabId through runMarkdown -> replaceDocsMarkdownRange
- Add warning when using --format markdown with --tab-id (DeleteContentRange
  does not support tab targeting at API level)
- Improve error messages to include match index on failure

Fixes openclaw#494
@steipete
Copy link
Copy Markdown
Collaborator

Thanks for the PR. I reviewed this against current main; I'm going to close this one rather than land it as-is.

Two blockers:

Happy to review a rebased/split version, but this mixed patch is no longer a good landing unit.

@steipete
Copy link
Copy Markdown
Collaborator

Closing per review above: mixed stale patch; needs a fresh focused Docs-tab PR.

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.

Bug: docs find-replace --format markdown silently does nothing

2 participants