Repository navigation
fix(map-ai): review fixes and shared AI plumbing for the map editing backend - #455
Merged
Merged
Conversation
…t rules These changes were made on 14 Oct and ran in the rest-api sidecar for the local and mqt.placeos.run demos, but were never committed: - set_id renames update the index in proposal order, so later ops can target the new id and the old id becomes free - set_attr viewBox is allowed on the SVG root only, with four finite numbers - prompt rules for preserving label font weight, composited overlay contrast, referencing ids created earlier in the same proposal, translucent booking overlays, shared-wall doorways and bounded canvas expansion Co-authored-by: Codex <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the proposal returned as a tool input, a response that stopped at max_tokens either had no tool_use block, which raised InvalidResponse, or a truncated one. Both skipped the runner's retry with a larger output budget. The adapter now sets finish to length before reading the tool input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server accepted any positive viewBox on the root, while the editor rejects one that crops the old map or grows it beyond four times. The op checker now applies the same rule against the viewBox the editor posts in the context, so the job's server issues agree with what the editor will allow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bounds line was written ahead of the ANNOTATIONS heading, so the markup part no longer started with its heading and map_ai_spec could not find it. It explains annotations drawn off the map, so it now sits under that heading and is left out when there are no annotations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ap adapters OpenAIImages and the map edit OpenAIChat adapter each carried the same base URL, Azure check, authentication headers and error mapping. They now include Utils::OpenAIVendor. The image adapter also treats Azure's content_filter error code as a moderation refusal, as the chat adapter already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rollers The map AI controller copied the signage AI controller's quota count, cancel action and recent-jobs query, differing only in the job kinds. They now live in Utils::AIJobs next to the shared long poll: remaining_ai_quota, request_job_cancel and recent_ai_jobs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Superseded: these commits were pushed straight to |
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.
Review fixes and de-duplication for the AI map editing backend, stacked on #453 (base
PPT-2832-ai-map-review).Fixes
length. With the proposal returned as a tool input, a response that stopped atmax_tokenseither had notool_useblock, which raisedInvalidResponse, or a truncated one. Either way the runner's retry with a larger budget never ran. New spec inspec/llm_anthropic_spec.cr.viewBoxon the root. The editor rejects one that crops the old map or grows it beyond four times, and the server now applies the same rule against the posted contextviewBox. New spec inspec/llm_prompt_spec.cr.map_ai_spec("sends the markup snapshot as an image part"). Codex had only run a focused subset of specs. It is also left out now when there are no annotations, since it only explains off-map marks.Reuse of the signage AI code
The map AI backend already shares most of the signage AI groundwork: provider rows, job rows and their long poll, the vendor HTTP client with its proxy and timeouts, slots, the upload store and sweep, error types and credential reading. The models PR (#334) extends the existing sums and usage with a kind filter rather than copying them. Two places had been copied instead:
Utils::OpenAIVendor.OpenAIImages(signage) andOpenAIChat(maps) carried the same base URL, Azure check, auth headers and error mapping. Both now include one module. The image adapter also maps Azure'scontent_filtercode to a moderation error, as the chat adapter already did.Utils::AIJobs. The map AI controller had copied the signage controller's quota count, cancel action and recent-jobs query, changing only the job kind. They are nowremaining_ai_quota,request_job_cancelandrecent_ai_jobs, next to the shared long poll.Left as they are:
quotas_foranddisableddiffer in their quota keys and response types, andusageis a one-line call in each controller.Verification
🤖 Generated with Claude Code