Skip to content

Commit 20a6893

Browse files
Kenoclaude
andcommitted
Fix auto mode to handle Dict-based problem lists with metadata
In auto mode, the server now properly handles problem lists that contain Dicts with metadata (new format) instead of just strings. Changes: - Extract "id" field from Dict when adding module prefix - Preserve all metadata when creating prefixed problems - Maintain backward compatibility with string-based problem lists This fixes the issue where auto mode would stringify the entire Dict instead of just the ID when prepending module prefixes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7703ae5 commit 20a6893

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/server.jl

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,16 @@ function (@main)(args)
751751
problems = Base.invokelatest(list_fn)
752752
# Add module prefix to each problem
753753
for problem in problems
754-
push!(all_problems, "$pkg_name-$problem")
754+
# Handle both old (String) and new (Dict) formats
755+
problem_id = problem isa Dict ? get(problem, "id", string(problem)) : string(problem)
756+
# Create prefixed problem with all metadata
757+
if problem isa Dict
758+
prefixed_problem = copy(problem)
759+
prefixed_problem["id"] = "$pkg_name-$problem_id"
760+
push!(all_problems, prefixed_problem)
761+
else
762+
push!(all_problems, "$pkg_name-$problem_id")
763+
end
755764
end
756765
if verbose
757766
println(stderr, "Found $(length(problems)) problems in module $pkg_name")
@@ -780,7 +789,16 @@ function (@main)(args)
780789
# Add module prefix to each problem
781790
module_name = string(nameof(obj))
782791
for problem in problems
783-
push!(all_problems, "$module_name-$problem")
792+
# Handle both old (String) and new (Dict) formats
793+
problem_id = problem isa Dict ? get(problem, "id", string(problem)) : string(problem)
794+
# Create prefixed problem with all metadata
795+
if problem isa Dict
796+
prefixed_problem = copy(problem)
797+
prefixed_problem["id"] = "$module_name-$problem_id"
798+
push!(all_problems, prefixed_problem)
799+
else
800+
push!(all_problems, "$module_name-$problem_id")
801+
end
784802
end
785803
if verbose
786804
println(stderr, "Found $(length(problems)) problems in loaded module $module_name")

0 commit comments

Comments
 (0)