Repository navigation
fix(wiki): restore rewritten image placeholders - #4301
Open
helloxjade wants to merge 1 commit into
Open
helloxjade wants to merge 1 commit into
helloxjade wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Wiki synthesis can rewrite
wkimg:0010aswkimg/0010, leaving an internal placeholder as a broken image URL in the stored page. Restore common separator, whitespace, case, and zero-padding variants to the original URL only when their complete numeric identifier exists in the current request's image map.Markdown images with unresolved
wkimgdestinations are removed. The same resolver handles tokens outside Markdown images, while captions and placeholder-like fragments inside real URLs remain intact. Regression tests cover rewritten references, unknown/malformed identifiers, real URLs, and a mock LLM returning a slash variant.Type of Change
Related Issue
Fixes #4294
Testing
Passed:
go test ./internal/application/service -run 'Test(MaskImageURLs|UnmaskImageURLs.*|GenerateWithTemplateMasksImageURLsBeforeLLM)$' -count=1golangci-lint run --new-from-rev=upstream/main ./internal/application/service(v2.14.0, 0 issues)git diff --check upstream/main...HEADgofmt -l internal/application/service/wiki_ingest.go internal/application/service/wiki_ingest_test.go(empty)The new regression tests failed before the fix and passed afterward.
Broader validation:
go test ./internal/application/service -count=1reports 42 unrelated failures. All 42 were reproduced with the two changed files replaced by their unmodifiedupstream/mainversions via Go's-overlayoption (base383d26535). Two retrieval tests expect log messages but receive the literaljsonformatter output; MCP and sandbox tests encounter local DNS results in the restricted198.18.0.0/15range forexample.comandapi.e2b.app.golangci-lint run --new-from-rev=upstream/main ./...was blocked by local disk exhaustion during package loading (no space left on device). The scoped lint above passed after clearing this task's temporary reproduction cache.Checklist