manage-memory-state-execution
GitHub Certified: Agentic AI Developer (GH-600) · 50 questions
- A GitHub Copilot agent running a long refactoring task begins producing inconsistent edits after processing 40 files. The agent seems to 'forget' the coding conventions it followed earlier. What is the most likely cause and the correct fix?
- An agent completes a code review task and produces findings. When a new agent session starts the next day to act on those findings, the new session has no knowledge of the prior review. Which memory architecture solves this cross-session continuity problem?
- An agent stores memory about user preferences and past task results in an external database. Over time, this memory grows large and may contain stale data. What should be configured to manage this?
- A long-running agent task is processing 200 code files over multiple hours. If the agent's execution is interrupted, the team needs to be able to resume without re-processing completed files. How should task progress be captured?
- An agent is running a multi-hour migration task when the GitHub Actions runner times out at 6 hours. The agent must restart but has no way to know what steps were already completed. What design pattern prevents this from becoming a wasted restart?
- A long-running agent started with a goal to refactor authentication code. After 50 tool calls, it is now modifying database schema files unrelated to authentication. What is this phenomenon called, and what is the best way to detect it?
- A team is running three specialized agents concurrently: one that triages GitHub issues, one that assigns labels, and one that drafts responses. All three agents read from and write to a shared state store containing the current issue queue. Two of the agents occasionally make conflicting updates to the same issue record simultaneously. Which approach best prevents conflicting and stale context in this shared state architecture?
- A multi-step agent workflow passes the outputs of Step 1 to Step 2 and Step 3. Step 2 and Step 3 run concurrently. What is the correct mechanism for ensuring both steps receive accurate state from Step 1?
- A developer support agent should remember user preferences (e.g., preferred coding language, test framework) across conversations. Which approach correctly implements this long-term memory?
- A developer is configuring a multi-step code review agent that needs to remember user feedback from a session that ended 3 hours ago. The agent also needs to retain the current file being reviewed during an active session and store long-term user style preferences across months. Which memory tier assignment is MOST appropriate?
- An agent is producing increasingly irrelevant suggestions as it processes more files. Logs show the context window contains documentation from 40 unrelated files that were loaded during earlier steps of the same session. The agent's suggestions have drifted significantly from the current task. What should the developer do to fix this?
- An agent is configured to run nightly refactoring passes on a codebase. After two weeks, the agent begins making contradictory changes — for example, converting snakecase to camelCase in some files while simultaneously converting camelCase back to snakecase in others. Logs reveal the agent is acting on cached refactoring recommendations from two weeks ago that conflict with more recent decisions. What memory policy should be applied to fix this?
- An agent is running a 50-file migration task. After processing 30 files successfully, the agent is interrupted due to a network timeout. When the developer restarts the agent, it begins the migration again from file 1, repeating all 30 already-completed migrations and causing data corruption. What should have been configured before starting the task to prevent this?
- You are configuring an agent that uses an MCP tool to apply automated code fixes across 100 repositories. The agent crashed at repository 47. You want to restart it so it resumes at repository 48 and applies exactly the same fix strategy decided in earlier runs. Which implementation correctly achieves this?
- A developer monitoring a long-running refactoring agent notices that after 6 hours, the agent begins applying a different variable naming convention than it used in the first 2 hours — despite no change in the task instructions. Which mechanism would most effectively detect and correct this drift before it affects more repositories?
- You have three parallel agents working on different modules of the same codebase. Each agent reads a shared state store at startup and writes its decisions back as it works. A developer reports that Agent B is making decisions that contradict Agent A's committed decisions from 10 minutes earlier. Which design pattern most directly resolves this conflict?
- An agent that processes multi-step code review tasks is failing to resume correctly after an interruption — every time it restarts, it starts the entire review from the beginning instead of picking up where it left off. Which root cause is most likely responsible?
- A long-running migration agent is processing 500 database records in batches of 50. After a server restart, the agent begins processing from the beginning and migrates the first 200 records a second time, creating duplicate entries. The agent has no record of which records were already processed. What state management mechanism was missing?
- After deploying an agent that assists with sprint planning, your team notices it is referencing tickets and decisions from a previous sprint as if they are still active. The agent's long-term memory store was populated during the last sprint and was never cleared. Which strategy best corrects this context drift?
- An agent that manages issue triage loads its context from a memory store at startup. The memory store contains information about repository state, open issues, and team assignments that was cached 72 hours ago. The agent makes triage decisions based on this stale data, incorrectly assigning closed issues and referencing team members who have since left the project. What is the root cause?
- A team reports that their deployment agent is repeating steps it already completed within the same session — it runs the linting step, then later runs it again before moving to the next phase. No interruption occurred. What is the most likely cause?
- Two instances of a code-review agent are running concurrently to handle high review volume. Both instances read the same shared state file that tracks which pull requests have been assigned for review, add their assignments to the list in memory, and then write the updated list back to the file. After several hours, the team notices that some pull requests are assigned to two reviewers while others have no reviewer, indicating state corruption. What is the root cause?
- An agent that processes pull requests in parallel is failing intermittently — sometimes it applies the wrong fix to the wrong PR, or skips a PR entirely. Investigation reveals that multiple concurrent agent instances are all reading from and writing to the same shared memory store using the same key namespace. Which fix addresses the root cause?
- An agent that monitors GitHub repositories accumulates every event it processes into an in-memory log and a persistent context store. After 30 days of operation, the agent's context store has grown to 2 GB and the agent's response latency has tripled because it loads the entire context store into its working memory on each invocation. No data has ever been removed from the store. What design decision was missing?
- After deploying a long-running research agent, you notice it consistently fails with a context window overflow error after approximately 50 tool calls. Inspection shows the agent appends every tool result in full to its running context and never removes or compresses any of it. Which remediation best solves this problem?
- An agent processes large code analysis tasks that typically take 45–60 minutes. The hosting environment enforces a 30-minute session timeout. When a session times out mid-task, all in-progress work is lost and the task must be restarted from scratch by a human. The agent stores all intermediate results only in the current session's working memory. What architectural change would prevent work loss on session timeout?
- A long-running code generation agent starts a session by deciding to use PostgreSQL as the database layer. After processing 80,000 tokens of code context, the agent begins generating SQLite queries in new modules, contradicting its earlier decision. No errors occur. What is causing this behavior?
- An agent relies on an external vector database for all its long-term memory retrieval. During a 30-minute database maintenance window, the agent fails completely — it cannot start new sessions, cannot recall any prior context, and surfaces errors to end users. The agent has no fallback behavior for memory store unavailability. What should the architecture include to prevent this?
- An agent runs across multiple sequential workflow jobs and needs to preserve intermediate results (such as parsed dependency graphs) between jobs without re-computing them. The data is only relevant for the current feature branch and does not need to persist beyond a week. Which GitHub mechanism is best suited for this use case?
- A long-running agent is working on a multi-week refactoring project. It needs to track which modules have been refactored, which are in progress, and which are pending, across multiple workflow runs and potentially multiple weeks. What is the best GitHub-native mechanism for this long-term task tracking?
- A code-refactoring agent loads repository state at the start of a long task. After 45 minutes of operation, the agent continues making changes based on its initial snapshot, but 12 other PRs have been merged in the meantime, creating conflicts. Which technique best prevents this context drift?
- A multi-agent pipeline runs dozens of tasks per day. Each sub-agent writes task-specific data to a shared memory store. After several weeks, the store has grown to hundreds of gigabytes of stale task data, causing slow lookups and increased costs. What is the recommended approach to address this?
- In a three-stage pipeline — research agent → synthesis agent → writing agent — the synthesis agent needs access to the raw findings produced by the research agent. Which state-sharing pattern is most appropriate?
- A PR-review agent needs to track which files it has already reviewed within a single PR session, and also needs to recall recurring code quality patterns observed across hundreds of previous PRs to improve future reviews. Which combination of memory types is most appropriate?
- A coordinator agent orchestrates a nightly batch pipeline and accumulates context across runs. After 30 days, the coordinator begins making decisions based on context from prior runs that is no longer relevant, causing incorrect task routing. What is the correct remediation?
- A customer support agent stores conversation context in session memory to handle multi-turn interactions. A privacy audit reveals that PII (customer names, email addresses, case numbers) is being retained in memory and included in logged context artifacts. The organization must remediate this before the next compliance review. Which approach BEST addresses both the data minimization and audit logging concerns?
- A Copilot agent helps developers by storing conversation context in a persistent external memory store for continuity across sessions. During a support interaction, a developer shares database connection strings and AWS credentials to help the agent debug a deployment issue. Two weeks later, a different developer on the same team queries the agent and receives those credentials in the context window. What design failure caused this and how should it be prevented?
- An organization stores Copilot agent memory in a cloud-hosted vector database to enable long-term context retrieval. A security audit finds that the vector embeddings and raw text chunks are stored unencrypted at rest, and the database is accessible using a single shared API key stored in a plain-text configuration file. Which two controls are most critical to implement immediately?
- An agent assists with employee onboarding. During a session, it learns the employee's name, job title, start date, department, manager name, and salary band. The agent is designed to support this employee in future sessions as well. Applying strict data minimization principles, which data should be retained in long-term memory for future sessions?
- An agent handles both general technical questions (public information) and proprietary architecture discussions (classified as internal confidential). Within a single session, the conversation transitions from a confidential architecture review back to answering general technical questions. A security review flags the risk that confidential architecture details could surface in the general-audience responses. Which memory management practice BEST mitigates this risk?
- A Copilot agent helps HR staff draft performance review templates by retrieving historical review examples from a database. The database contains real employee reviews with names, performance ratings, and compensation data. The agent retrieves these as context and occasionally surfaces employee names and salaries in its responses to other users. Which data handling practice should be implemented to address this GDPR and privacy concern?
- A code generation agent runs a 45-minute workflow to refactor a large codebase. It operates entirely in-memory and produces no persistent artifacts until delivering the final output. The workflow fails at minute 43 due to a GitHub API rate limit. The team loses all progress and must restart from scratch. Which design change would enable the agent to safely resume from a checkpoint rather than restarting the full workflow?
- An agent stores a GitHub App installation token in its working memory at the start of a long-running workflow. GitHub App installation tokens expire after 1 hour. The workflow is expected to run for 2 hours. At the 70-minute mark, the agent attempts a GitHub API call and receives a 401 Unauthorized response. What is the CORRECT recovery pattern for this scenario?
- An agent is designed to assist a software team continuously over several weeks, tracking which PRs it has reviewed, what architectural decisions it has recorded, and the conversational context from each daily session. Which memory architecture MOST correctly handles these different types of information?
- An organization runs five different agents that share a common external vector store for memory. Agent 1 stores sensitive security findings; Agent 2 stores general code style notes; Agent 3 stores HR-related information. A developer is concerned that Agent 2 could retrieve Agent 1's security findings or Agent 3's HR data through semantic similarity searches. Which memory isolation approach MOST effectively prevents cross-agent memory leakage?
- A long-running agent has accumulated 18 months of memory entries in its external vector store. The store is becoming expensive to query and store. The team needs to implement a pruning policy. Which pruning strategy MOST appropriately balances cost with retention of valuable memory?
- An agent that depends on an external vector store for long-term memory experiences a scenario where the vector store is unavailable due to a planned maintenance window. The agent is mid-task when the outage begins. Which degraded-mode behavior MOST appropriately handles this situation?
- An organization runs two agent instances that share a common external memory store. Agent Instance A and Agent Instance B both retrieve context from the same vector store and both write new entries to it. An engineer is concerned about memory consistency — specifically, that both instances might simultaneously write conflicting entries about the same topic, creating divergent or contradictory memory. Which mechanism MOST effectively prevents this consistency problem?
- A long-running agent is tasked with 'migrate the authentication service to use OAuth 2.0.' After 2 hours and dozens of tool calls, an engineer reviews the agent's current actions and notices it is now modifying the payment processing module's session management code — a task that was never part of the original assignment. The agent's reasoning still references 'authentication improvements' but the actual changes have drifted significantly from the original scope. Which mechanism would BEST detect and correct this context drift?
- An agent pipeline consists of three sequential tools: a CodeAnalysisTool that identifies functions to refactor, a RefactoringTool that applies the changes, and a TestRunnerTool that validates the output. The agent passes state between tools by appending each tool's output to the conversation context. After testing, the team notices that when the CodeAnalysisTool's output is long (>2000 tokens), the TestRunnerTool sometimes receives incomplete state because earlier context was truncated from the window. Which state-sharing mechanism would MOST reliably solve this problem?