Reviewer · Documentation
Document behavior in code
Document non-obvious behavior, limitations, and scope directly in the code (docstrings/comments), not only in the PR description, since PR descriptions are not visible to someone reading the source later. When a function's guarantees are partial (e.g., `to_dict(strict=True)` only propagates `strict` to `SerializableMixin` attributes and not to other...
Document non-obvious behavior, limitations, and scope directly in the code (docstrings/comments), not only in the PR description, since PR descriptions are not visible to someone reading the source later. When a function’s guarantees are partial (e.g., to_dict(strict=True) only propagates strict to SerializableMixin attributes and not to other objects’ own to_dict() implementations), add an explicit note in the docstring’s Args/Returns/Notes section stating the exact scope, as was eventually done for to_dict’s strict argument. Similarly, when a change alters the shape or keys of a public output (e.g., excluding llm_manager, tool_manager, etc. from Agent.to_dict()), record it as a durable, in-repo note (CHANGELOG entry or docstring remark) rather than relying solely on the PR body, since that context will not travel with the code. For intentionally-kept but currently-unreferenced code (e.g., _read_shared_state, retained for audit purposes), add a short docstring explaining why it exists and why it should not be removed, to prevent accidental deletion by future refactors or linters. Finally, keep inline comments synchronized with the code they describe: when code under a comment block is deleted or moved, delete or update the comment too, as in the case of a leftover # System shutdown / reboot header with no entries beneath it. Treat any comment or docstring left out of sync with the code as a bug.