Fix Exercise 1.2 structured output comments and create_entry tags bug #14
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.
Problem
Exercise 1.2 (Advanced Tools, Structured Output) had several issues that were confusing students:
Incorrect comment for
add_tag_to_entry
: The comment said to usetagEntry that is an entryTagSchema
but the solution implementation actually usesentryTag: entryTagSchema
Misleading video schema comment: The comment suggested creating a schema "with a video that includes videoUri" but the actual solution uses
{ videoUri: z.string() }
directlyCritical bug in solution: The
create_entry
function was returningstructuredContent: { entry: createdEntry }
after adding tags, butcreatedEntry
didn't include the newly added tags since they were added after entry creation. This meant the structured output would show entries with empty tags arrays even when tags were successfully added.Solution
Fixed comments in problem file to match solution implementation:
tagEntry
→entryTag
in add_tag_to_entry commentvideoUri field
directlyFixed the create_entry bug in solution by refetching the entry after adding tags:
This ensures that when students create entries with tags, the structured output correctly includes the complete entry with its associated tags, matching the
entryWithTagsSchema
expectation.Impact
create_entry
tool correctly returns entries with their associated tagsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Note
Aligns problem comments with solution and fixes create_entry to refetch the entry so structured output includes tags.
create_entry
to refetch the entry after adding tags; add invariant hint.add_tag_to_entry
comment to useentryTag: entryTagSchema
.create_wrapped_video
comment to specifyvideoUri
field.create_entry
, refetch entry (agent.db.getEntry
) after adding tags and assert presence; use the refetchedentryWithTags
forstructuredContent
, messages, and resource link.Written by Cursor Bugbot for commit df4e74b. This will update automatically on new commits. Configure here.