fix(memory): batch-wrap create_observation and remove observation auto-creation#90
Open
ryanrishi wants to merge 3 commits into
Open
fix(memory): batch-wrap create_observation and remove observation auto-creation#90ryanrishi wants to merge 3 commits into
ryanrishi wants to merge 3 commits into
Conversation
The Observations endpoint is a batch-create API expecting
{"observations": [ ... ]}, but create_observation posted a single
observation at the top level. Wrap the observation in an observations
array and default occurredAt to the current time when the caller omits
it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ation Per a product decision, TAC no longer creates observations after conversations end. Remove the observation dispatch branch in _process_operator_result, the _process_observation_event method, and its _parse_observations_content helper. The summary path is unchanged. observation_operator_sid remains accepted for backward compatibility but is now ignored; its docstring notes the deprecation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Fixes the Conversation Memory observation flow by aligning create_observation() with the batch-create API contract and removing post-conversation observation auto-creation from the intelligence event processor.
Changes:
- Wrap
create_observation()request bodies in anobservationsarray and defaultoccurredAtwhen omitted. - Remove observation operator parsing/dispatching from
OperatorResultProcessorand adjust tests accordingly. - Deprecate (accept-but-ignore)
observation_operator_sidin config docs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_profile_retrieval.py | Adds HTTP-level tests asserting create_observation() payload wrapping and default timestamp behavior. |
| tests/test_intelligence.py | Removes observation parsing/creation tests and updates processor tests to reflect observation auto-creation removal. |
| src/tac/intelligence/operator_result_processor.py | Removes observation parsing/dispatch path and updates docs/logic to only create summaries. |
| src/tac/core/config.py | Deprecates observation_operator_sid via description update while keeping field for compatibility. |
| src/tac/context/memory.py | Fixes create_observation() payload shape and defaults occurredAt to current UTC time. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- create_observation: default occurred_at only when it is None (via an explicit is-None check) so a caller-supplied falsy value such as an empty string is preserved. - create_observation: reword the content docstring to describe an observation as an extracted fact/note, not summary text. - operator result processor: distinguish an unconfigured summary operator SID (clearer skip reason) from a configured SID that doesn't match the operator. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Two related fixes to the Conversation Memory observation flow (Python parity for twilio/twilio-agent-connect-typescript#81):
create_observation()sent an unwrapped body. The Observations endpoint is a batch-create API expecting{"observations": [ { ... } ]}, but the method posted a single observation at the top level. It also only includedoccurredAtwhen the caller passed it. The body is now wrapped in anobservationsarray, andoccurredAtdefaults to the current UTC time (ISO 8601) when omitted. The method stays public.Removed internal post-conversation observation auto-creation. Per a product decision, TAC no longer mechanically creates observations after conversations end. Removed the observation dispatch branch in
_process_operator_result, the_process_observation_eventmethod, and its_parse_observations_contenthelper. An operator result matching neither summary nor the (former) observation operator now skips as unconfigured. The summary path is fully intact.observation_operator_sidonConversationIntelligenceConfigis retained (GA, no breaking change) but is now accepted-and-ignored, with a deprecation note in its description.Type of Change
Checklist
SDK Parity
This is the Python SDK parity fix for twilio/twilio-agent-connect-typescript#81.
🤖 Generated with Claude Code